Skip to main content

A simple Python module to block websites.

Reason this release was yanked:

wrong build

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


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.0.1.tar.gz (5.1 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.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web_block-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for web_block-1.0.1.tar.gz
Algorithm Hash digest
SHA256 38641b71f0f472d1f42861dda52df7aea6256e526958f15f4b257869804d51cc
MD5 f6d1b64432e5bb36041795e21ba63047
BLAKE2b-256 edd849683c80abb412fb8db177a6470ce340263e03794e436afe7faf09af03e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: web_block-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for web_block-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c92bff591a2c969b14874fbc311ef2c7d507234098922a05ad376ec2c10f14c9
MD5 f67b60dda1ac8a6c83075d26c87215c8
BLAKE2b-256 b3406ccc5b6c03aa9309d17a89c31b4e07b0e73715a88077d1b212172075b69f

See more details on using hashes here.

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