Skip to main content

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`

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web_block-1.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web_block-1.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file web_block-1.1.0.tar.gz.

File metadata

  • Download URL: web_block-1.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for web_block-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d3405e7eaa6e57ad19de2cba09fa73ed2695b5de03cf8640197506b6b6e06364
MD5 5d11deb733c8d31b5e51ebe16818d680
BLAKE2b-256 4805eaad4531ae17dd3ba76d3de7e34edc099b2585f8de20469f953630979492

See more details on using hashes here.

Provenance

The following attestation bundles were made for web_block-1.1.0.tar.gz:

Publisher: publish.yml on ok-coder1/web_block

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file web_block-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: web_block-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for web_block-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b4400dcc22771387b016d09794ed1b1ce376024be4e694c19d87d70e8ceb5f9
MD5 2bd47d6010c428543f378127237b8b77
BLAKE2b-256 49415ed0139b0f6bdfdaf9738a5168fb4c02e500bb390b5912bb0fa053de9519

See more details on using hashes here.

Provenance

The following attestation bundles were made for web_block-1.1.0-py3-none-any.whl:

Publisher: publish.yml on ok-coder1/web_block

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page