A package to generate random IP addresses for a given country code
Project description
Random IP Generator
Random IP Generator is a Python package that generates a random IP address for a given country code. It uses the IP2LOCATION-LITE-DB1.CSV
file as a source for IP ranges per country.
Installation
You can install the package via pip:
pip install random-ip-generator
Usage
After installing the package, you can use the random_ip_for_country
function in your Python script to generate a random IP address for a given country.
from random_ip_generator import random_ip_for_country
country_code = "US"
random_ip = random_ip_for_country(country_code)
print(f"Random IP for {country_code}: {random_ip}")
Prerequisites
This package requires the ipaddress
package. It will be installed automatically if you install random-ip-generator
via pip.
Attribution
This site or product includes IP2Location LITE data available from https://lite.ip2location.com.
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
Built Distribution
Hashes for random-ip-generator-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d07a77f939c5619e47c7570d08878d25c04f5fe5d3f3083258ae5218449dc5bd |
|
MD5 | fe4b4bbeb34113d2163918cc05a81cc0 |
|
BLAKE2b-256 | ea327cbc7935f8768c9437a99c16c8b5fd5a30b0c478a31afec73794bdbc0230 |
Hashes for random_ip_generator-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0e1edb8ab9e8ea57aad8a366b955db06ea56593216bfbd7dbbea673f59ae962 |
|
MD5 | dd3a6ede27b8b08eca6c208675f539a3 |
|
BLAKE2b-256 | bd3e6f300c07efbddfa0934874bfca05059471f4b9738a5540d9062dc0942c23 |