Skip to main content

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

  1. From pypi !:
    pip install PyIpBlocker
    

Project details


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)

Uploaded Source

Built Distribution

PyIpBlocker-0.0.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for pyipblocker-0.0.4.tar.gz
Algorithm Hash digest
SHA256 226519e3225bd93fb75878c2b2b36874688c12cfffeeb0df0358b29d78d9f38c
MD5 d23f991df2907978c4775da2aaf107b1
BLAKE2b-256 5eb2755a92ae718869896f33b0d3ecfa5dc5ce146e367a5a9c6d0514bc3ec6f6

See more details on using hashes here.

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

Hashes for PyIpBlocker-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5fddfe2a4ab0b0282cdbb513024a187c768938ddc7222953b8ed6c265b8f2d9
MD5 ff26912eb7e9201025f5594a6a63cb09
BLAKE2b-256 8d373c894fabd2e5a61115d5eabb14605076b0857a65237ac80f421b48d8384b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page