Skip to main content

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`

Metadata

Release files for web-block 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for web-block 1.1.0
File Size Uploaded
web_block-1.1.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for web-block 1.1.0
File Interpreter ABI Platform
web_block-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / web_block-1.1.0.tar.gz

Download URL web_block-1.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d3405e7eaa6e57ad19de2cba09fa73ed2695b5de03cf8640197506b6b6e06364
BLAKE2b-256 checksum
How to use checksums
4805eaad4531ae17dd3ba76d3de7e34edc099b2585f8de20469f953630979492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / web_block-1.1.0-py3-none-any.whl

Download URL web_block-1.1.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b4400dcc22771387b016d09794ed1b1ce376024be4e694c19d87d70e8ceb5f9
BLAKE2b-256 checksum
How to use checksums
49415ed0139b0f6bdfdaf9738a5168fb4c02e500bb390b5912bb0fa053de9519
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page