Skip to main content

Block helps you stop procrastinating, since you can't do it by yourself. It is a simple command-line utility that relies on modifying the hosts file to block websites that you use when procrastinating.

Project description


PyPI Code style: black

Block is a simple Python-based command line utility for blocking access to web sites in order to stop you from procrastinating, because you can't do it by yourself. Relies on modifying the hosts file.


It is possible to install Block using the Python package manager, pip:

$ pip install block-hosts


The simplest and most common usage of Block is to block all sites in a curated list. To do this, run the following command in the console:

$ block-hosts block-all

and to unblock, run:

$ block-hosts unblock-all

To block a profile of web sites, such as "social" or "news", run:

$ block-hosts block-profile PROFILE_NAME

and to unblock, run:

$ block-hosts unblock-profile PROFILE_NAME

To block a single web site, run:

$ block-hosts WEBSITE_URL

where website_url refers to, you guessed it, the URL of the website you want to block. To reverse the action, run

$ block-hosts unblock WEBSITE_URL

Note: modifying the hosts file requires administrator privileges, so make sure that the terminal is in elevated mode.

Another note: you might need to restart the browser for changes to take effect.

Project details

Download files

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

Files for block-hosts, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size block_hosts-0.0.3-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size block_hosts-0.0.3.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page