A small package for block and unblock ip in python
Project description
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
- From pypi !:
pip install PyIpBlocker
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyipblocker-0.0.4.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file pyipblocker-0.0.4.tar.gz
.
File metadata
- Download URL: pyipblocker-0.0.4.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 226519e3225bd93fb75878c2b2b36874688c12cfffeeb0df0358b29d78d9f38c |
|
MD5 | d23f991df2907978c4775da2aaf107b1 |
|
BLAKE2b-256 | 5eb2755a92ae718869896f33b0d3ecfa5dc5ce146e367a5a9c6d0514bc3ec6f6 |
File details
Details for the file PyIpBlocker-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: PyIpBlocker-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5fddfe2a4ab0b0282cdbb513024a187c768938ddc7222953b8ed6c265b8f2d9 |
|
MD5 | ff26912eb7e9201025f5594a6a63cb09 |
|
BLAKE2b-256 | 8d373c894fabd2e5a61115d5eabb14605076b0857a65237ac80f421b48d8384b |