Metadata-Version: 2.4
Name: web_block
Version: 1.0.0
Summary: A simple Python module to block websites.
Project-URL: Homepage, https://github.com/ok-coder1/web_block
Project-URL: Documentation, https://github.com/ok-coder1/web_block/wiki
Project-URL: Repository, https://github.com/ok-coder1/web_block.git
Project-URL: Issues, https://github.com/ok-coder1/web_block/issues
Author-email: okcoder1 <codershub.code@gmail.com>
Maintainer-email: okcoder1 <codershub.code@gmail.com>
License-Expression: MIT
License-File: LICENSE.md
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: POSIX :: SunOS/Solaris
Classifier: Operating System :: Unix
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: python-hosts
Requires-Dist: tldextract
Description-Content-Type: text/markdown

# web_block

A simple Python module to block websites. \
It configures the hosts file (`/etc/hosts` on macOS or Linux and `C:\Windows\System32\drivers\etc\hosts` on Windows) to redirect a website passed in as an argument to localhost (`127.0.0.1`), essentially blocking it.

PyPI here: https://pypi.org/project/web-block

## Usage:
### Blocking websites
```py
import web_block
web_block.block("example.com example.org") # Use spaces to separate websites.
```
It's as simple as that.
### Unblocking websites
```py
import web_block
web_block.unblock("example.com example.org") # You can also use `https://www.example.com/abcd.html` and it will automatically get the domain for you.
```
