semvec/pypi-packages huggingface dataset:
PyIpBlocker 0.0.4
A small package for block and unblock ip in python
License: MIT License
Requires Python: >=3.8
Keywords: IpUtil, Ip, Block, Unblock, utility, Blocker

# 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