Metadata-Version: 2.4
Name: nextdns-blocker
Version: 6.5.3
Summary: Automated domain blocking controller for NextDNS with per-domain scheduling
Project-URL: Homepage, https://github.com/aristeoibarra/nextdns-blocker
Project-URL: Repository, https://github.com/aristeoibarra/nextdns-blocker
Project-URL: Issues, https://github.com/aristeoibarra/nextdns-blocker/issues
Project-URL: Changelog, https://github.com/aristeoibarra/nextdns-blocker/blob/main/CHANGELOG.md
Author-email: Aristeo Ibarra <aristeo.dev@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: automation,blocking,dns,nextdns,parental-control,scheduling
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: System :: Networking
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: click>=8.0.0
Requires-Dist: platformdirs>=3.0.0
Requires-Dist: requests<3.0.0,>=2.28.0
Requires-Dist: rich>=13.0.0
Requires-Dist: tzdata>=2023.3
Provides-Extra: dev
Requires-Dist: bandit>=1.7.0; extra == 'dev'
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: freezegun>=1.2.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest-xdist>=3.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: responses>=0.23.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: safety>=2.3.0; extra == 'dev'
Requires-Dist: types-requests>=2.28.0; extra == 'dev'
Description-Content-Type: text/markdown

# NextDNS Blocker

[![PyPI version](https://img.shields.io/pypi/v/nextdns-blocker)](https://pypi.org/project/nextdns-blocker/)
[![PyPI downloads](https://img.shields.io/pypi/dm/nextdns-blocker)](https://pypi.org/project/nextdns-blocker/)
[![Python versions](https://img.shields.io/pypi/pyversions/nextdns-blocker)](https://pypi.org/project/nextdns-blocker/)
[![License](https://img.shields.io/github/license/aristeoibarra/nextdns-blocker)](LICENSE)
[![CI](https://github.com/aristeoibarra/nextdns-blocker/actions/workflows/ci.yml/badge.svg)](https://github.com/aristeoibarra/nextdns-blocker/actions/workflows/ci.yml)
[![Homebrew](https://img.shields.io/badge/homebrew-tap-blue)](https://github.com/aristeoibarra/homebrew-tap)

Automated domain blocking with per-domain scheduling via the NextDNS API. Build healthier digital habits through intelligent scheduling and friction-based protection.

## Features

- **Per-domain scheduling** - Configure unique availability hours for each domain
- **Domain categories** - Group domains together with shared schedules
- **NextDNS Parental Control** - Enable/disable native NextDNS categories and services
- **Unblock delays** - Add friction against impulsive unblocking (30m, 4h, 24h, or never)
- **Panic mode** - Emergency lockdown that blocks all domains
- **Cross-platform** - Native support for macOS, Linux, and Windows
- **Automatic sync** - Watchdog runs every 2 minutes to enforce schedules
- **Discord notifications** - Real-time alerts for block/unblock events
- **Allowlist with schedules** - Time-based exceptions for specific domains
- **Priority-based filtering** - Allowlist always wins over category/service blocks

## Quick Install

### Homebrew (macOS/Linux)

```bash
brew tap aristeoibarra/tap
brew install nextdns-blocker
nextdns-blocker init
```

### pip

```bash
pip install nextdns-blocker
nextdns-blocker init
```

### Docker

```bash
git clone https://github.com/aristeoibarra/nextdns-blocker.git
cd nextdns-blocker
cp .env.example .env && cp config.json.example config.json
docker compose up -d
```

## Quick Start

1. Get your [NextDNS API Key](https://my.nextdns.io/account) and Profile ID
2. Run `nextdns-blocker init` to configure
3. Edit your domains: `nextdns-blocker config edit`
4. Install watchdog: `nextdns-blocker watchdog install`

## Documentation

For complete documentation, visit: **[nextdns-blocker.pages.dev](https://nextdns-blocker.pages.dev)**

- [Getting Started](https://nextdns-blocker.pages.dev/getting-started/)
- [Commands Reference](https://nextdns-blocker.pages.dev/commands/)
- [Configuration Guide](https://nextdns-blocker.pages.dev/configuration/)

## Basic Commands

```bash
nextdns-blocker sync              # Sync based on schedules
nextdns-blocker status            # Check current blocking status
nextdns-blocker pause [minutes]   # Pause blocking temporarily
nextdns-blocker resume            # Resume blocking
nextdns-blocker unblock <domain>  # Manually unblock a domain
nextdns-blocker panic <minutes>   # Activate emergency lockdown
```

## Example Configuration

```json
{
  "blocklist": [
    {
      "domain": "reddit.com",
      "unblock_delay": "30m",
      "schedule": {
        "available_hours": [
          {
            "days": ["monday", "tuesday", "wednesday", "thursday", "friday"],
            "time_ranges": [
              {"start": "12:00", "end": "13:00"},
              {"start": "18:00", "end": "22:00"}
            ]
          }
        ]
      }
    }
  ]
}
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

MIT
