A simple Python module to block websites.
Project description
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
import web_block
web_block.block("example.com example.org") # Use spaces to separate websites.
It's as simple as that.
Unblocking websites
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file web_block-1.0.2.tar.gz.
File metadata
- Download URL: web_block-1.0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbf58a8bb32c7d71924018bd0446b0cb0e7f92d02fd288efa1d6d05f79dbe4ca
|
|
| MD5 |
b560d501c2b300cd9b172896888ec232
|
|
| BLAKE2b-256 |
7923620516ebf701b16edeb551ae6bdd7f6a3e489f84b23880235fe278c11c3d
|
File details
Details for the file web_block-1.0.2-py3-none-any.whl.
File metadata
- Download URL: web_block-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35bf092c895a4ca46a39fd920b1046b3f0b29210b80d4ef51564f9a582680e9c
|
|
| MD5 |
10d76135a4375aa660bcad8ab75e92fe
|
|
| BLAKE2b-256 |
33b028203d992bc3d0f90c1a9410ffc8a5029dbef51066679def8287438af77b
|