# PyIpBlocker
This Python script allows you to block and unblock IP addresses or domain names in the system's hosts file. It works by adding entries for specified IP addresses or domain names to redirect them to the loopback IP (127.0.0.1), effectively blocking them.
## Features
- **Block IPs or Domains**: Add entries to the hosts file to prevent access to specified IP addresses or domains.
- **Unblock IPs or Domains**: Remove entries from the hosts file to restore access to specified IP addresses or domains.
- **Automatic Check**: Before blocking, checks if an IP or domain is already blocked to avoid duplicate entries.
- **Error Handling**: Provides informative error messages for permission issues and other exceptions.
## Prerequisites
- **Python 3.6+**: This script requires Python 3.6 or higher.
- **Administrator Privileges**: Modifying the hosts file requires administrator or root privileges.
## Installation
1. **From pypi !**:
```bash
pip install PyIpBlocker
Raw data
{
"_id": null,
"home_page": null,
"name": "PyIpBlocker",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "IpUtil, Ip, Block, Unblock, utility, Blocker",
"author": null,
"author_email": "ZachVFX <zachallrd@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/5e/b2/755a92ae718869896f33b0d3ecfa5dc5ce146e367a5a9c6d0514bc3ec6f6/pyipblocker-0.0.4.tar.gz",
"platform": null,
"description": "# PyIpBlocker\r\n\r\nThis Python script allows you to block and unblock IP addresses or domain names in the system's hosts file. It works by adding entries for specified IP addresses or domain names to redirect them to the loopback IP (127.0.0.1), effectively blocking them.\r\n\r\n## Features\r\n\r\n- **Block IPs or Domains**: Add entries to the hosts file to prevent access to specified IP addresses or domains.\r\n- **Unblock IPs or Domains**: Remove entries from the hosts file to restore access to specified IP addresses or domains.\r\n- **Automatic Check**: Before blocking, checks if an IP or domain is already blocked to avoid duplicate entries.\r\n- **Error Handling**: Provides informative error messages for permission issues and other exceptions.\r\n\r\n## Prerequisites\r\n\r\n- **Python 3.6+**: This script requires Python 3.6 or higher.\r\n- **Administrator Privileges**: Modifying the hosts file requires administrator or root privileges. \r\n\r\n## Installation\r\n\r\n1. **From pypi !**:\r\n ```bash\r\n pip install PyIpBlocker\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A small package for block and unblock ip in python",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/ZachVFXX/PyIpBlocker/tree/main",
"Issues": "https://github.com/ZachVFXX/PyIpBlocker/issues"
},
"split_keywords": [
"iputil",
" ip",
" block",
" unblock",
" utility",
" blocker"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8d373c894fabd2e5a61115d5eabb14605076b0857a65237ac80f421b48d8384b",
"md5": "ff26912eb7e9201025f5594a6a63cb09",
"sha256": "e5fddfe2a4ab0b0282cdbb513024a187c768938ddc7222953b8ed6c265b8f2d9"
},
"downloads": -1,
"filename": "PyIpBlocker-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ff26912eb7e9201025f5594a6a63cb09",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4310,
"upload_time": "2024-11-01T22:34:22",
"upload_time_iso_8601": "2024-11-01T22:34:22.306541Z",
"url": "https://files.pythonhosted.org/packages/8d/37/3c894fabd2e5a61115d5eabb14605076b0857a65237ac80f421b48d8384b/PyIpBlocker-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5eb2755a92ae718869896f33b0d3ecfa5dc5ce146e367a5a9c6d0514bc3ec6f6",
"md5": "d23f991df2907978c4775da2aaf107b1",
"sha256": "226519e3225bd93fb75878c2b2b36874688c12cfffeeb0df0358b29d78d9f38c"
},
"downloads": -1,
"filename": "pyipblocker-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "d23f991df2907978c4775da2aaf107b1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3913,
"upload_time": "2024-11-01T22:34:23",
"upload_time_iso_8601": "2024-11-01T22:34:23.472123Z",
"url": "https://files.pythonhosted.org/packages/5e/b2/755a92ae718869896f33b0d3ecfa5dc5ce146e367a5a9c6d0514bc3ec6f6/pyipblocker-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-01 22:34:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ZachVFXX",
"github_project": "PyIpBlocker",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyipblocker"
}