stopweb


Namestopweb JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA CLI tool to temporarily block websites by modifying the hosts file
upload_time2025-11-04 11:33:24
maintainerNone
docs_urlNone
authorStopWeb
requires_python<4.0.0,>=3.8.1
licenseMIT
keywords website blocking productivity focus hosts
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # StopWeb

Block websites permanently to help you stay focused. Works by editing your system's hosts file. You can also set a temporary duration if needed.

I built this because I kept getting distracted by social media and news sites when trying to work. Simple solution: block them until you decide to unblock.

## What it does

- Blocks websites until you manually unblock them
- Works on Mac, Linux, and Windows
- Lets you see what's currently blocked
- Can unblock sites early if needed

## Install

 
```bash
pip install stopweb
```

## Basic usage

Block Facebook permanently:

```bash
sudo stopweb facebook.com
```

Block multiple sites at once:

```bash
sudo stopweb facebook.com youtube.com reddit.com
```

See what's blocked:

```bash
sudo stopweb --list
```

Unblock a site:

```bash
sudo stopweb --remove facebook.com
```

Remove all blocks:

```bash
sudo stopweb --clear
```

Temporarily block a site (expires automatically):

```bash
sudo stopweb -d 2h twitter.com      # 2 hours
sudo stopweb --duration 1d reddit.com  # 1 day
```

## How it works

StopWeb edits your hosts file to redirect blocked sites to localhost (127.0.0.1).

On Mac/Linux that's `/etc/hosts`, on Windows it's `C:\Windows\System32\drivers\etc\hosts`.

It adds lines like:

```text
127.0.0.1    facebook.com    # StopWeb:
# For temporary blocks, an expiry is recorded, e.g.
127.0.0.1    twitter.com     # StopWeb: expires=2025-01-01T12:00:00
```

Blocked sites stay blocked until you run the remove or clear command.

## Notes

- Requires sudo/admin privileges (needs to edit system files)
- You might need to clear your browser cache after blocking/unblocking
- Creates a backup of your hosts file before making changes
- If something goes wrong, your original hosts file is saved as `hosts.stopweb_backup`
- Temporary blocks are removed automatically by running `stopweb --cleanup`

## Why not just use browser extensions?

Browser extensions can be easily disabled when you're feeling weak. Editing the hosts file is more permanent - you'd have to remember the exact command to undo it.

Plus this works system-wide, not just in your browser.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "stopweb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "website, blocking, productivity, focus, hosts",
    "author": "StopWeb",
    "author_email": "stopweb@example.com",
    "download_url": "https://files.pythonhosted.org/packages/10/be/8f9d5620d1d3f645bbc2f0fc67d0cc01b613fd8843e4553a5b262a705453/stopweb-0.1.1.tar.gz",
    "platform": null,
    "description": "# StopWeb\n\nBlock websites permanently to help you stay focused. Works by editing your system's hosts file. You can also set a temporary duration if needed.\n\nI built this because I kept getting distracted by social media and news sites when trying to work. Simple solution: block them until you decide to unblock.\n\n## What it does\n\n- Blocks websites until you manually unblock them\n- Works on Mac, Linux, and Windows\n- Lets you see what's currently blocked\n- Can unblock sites early if needed\n\n## Install\n\n \n```bash\npip install stopweb\n```\n\n## Basic usage\n\nBlock Facebook permanently:\n\n```bash\nsudo stopweb facebook.com\n```\n\nBlock multiple sites at once:\n\n```bash\nsudo stopweb facebook.com youtube.com reddit.com\n```\n\nSee what's blocked:\n\n```bash\nsudo stopweb --list\n```\n\nUnblock a site:\n\n```bash\nsudo stopweb --remove facebook.com\n```\n\nRemove all blocks:\n\n```bash\nsudo stopweb --clear\n```\n\nTemporarily block a site (expires automatically):\n\n```bash\nsudo stopweb -d 2h twitter.com      # 2 hours\nsudo stopweb --duration 1d reddit.com  # 1 day\n```\n\n## How it works\n\nStopWeb edits your hosts file to redirect blocked sites to localhost (127.0.0.1).\n\nOn Mac/Linux that's `/etc/hosts`, on Windows it's `C:\\Windows\\System32\\drivers\\etc\\hosts`.\n\nIt adds lines like:\n\n```text\n127.0.0.1    facebook.com    # StopWeb:\n# For temporary blocks, an expiry is recorded, e.g.\n127.0.0.1    twitter.com     # StopWeb: expires=2025-01-01T12:00:00\n```\n\nBlocked sites stay blocked until you run the remove or clear command.\n\n## Notes\n\n- Requires sudo/admin privileges (needs to edit system files)\n- You might need to clear your browser cache after blocking/unblocking\n- Creates a backup of your hosts file before making changes\n- If something goes wrong, your original hosts file is saved as `hosts.stopweb_backup`\n- Temporary blocks are removed automatically by running `stopweb --cleanup`\n\n## Why not just use browser extensions?\n\nBrowser extensions can be easily disabled when you're feeling weak. Editing the hosts file is more permanent - you'd have to remember the exact command to undo it.\n\nPlus this works system-wide, not just in your browser.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A CLI tool to temporarily block websites by modifying the hosts file",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/stopweb/stopweb",
        "Repository": "https://github.com/stopweb/stopweb"
    },
    "split_keywords": [
        "website",
        " blocking",
        " productivity",
        " focus",
        " hosts"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3331eb6057c2a0a521b9a357d1d32cf634a068fc15a7ce4aaaa7bc6951290816",
                "md5": "031095df8bf8c71f5fcf50be4d22c400",
                "sha256": "5710bb7bcdbbe4445bc72c44e730659c2cc9b1df41e8243b790b14177299560d"
            },
            "downloads": -1,
            "filename": "stopweb-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "031095df8bf8c71f5fcf50be4d22c400",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 12231,
            "upload_time": "2025-11-04T11:33:20",
            "upload_time_iso_8601": "2025-11-04T11:33:20.502342Z",
            "url": "https://files.pythonhosted.org/packages/33/31/eb6057c2a0a521b9a357d1d32cf634a068fc15a7ce4aaaa7bc6951290816/stopweb-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "10be8f9d5620d1d3f645bbc2f0fc67d0cc01b613fd8843e4553a5b262a705453",
                "md5": "d703489c8b34628029cda2ca49620f5e",
                "sha256": "23f9b096788aff54f16c63cb541ef78535c7689dec6d935d0a018d3bb5488e23"
            },
            "downloads": -1,
            "filename": "stopweb-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d703489c8b34628029cda2ca49620f5e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 10822,
            "upload_time": "2025-11-04T11:33:24",
            "upload_time_iso_8601": "2025-11-04T11:33:24.124998Z",
            "url": "https://files.pythonhosted.org/packages/10/be/8f9d5620d1d3f645bbc2f0fc67d0cc01b613fd8843e4553a5b262a705453/stopweb-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-04 11:33:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stopweb",
    "github_project": "stopweb",
    "github_not_found": true,
    "lcname": "stopweb"
}
        
Elapsed time: 2.04772s