Skip to main content

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

random-ip-generator-0.1.1.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

random_ip_generator-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file random-ip-generator-0.1.1.tar.gz.

File metadata

  • Download URL: random-ip-generator-0.1.1.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for random-ip-generator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cf9557117c662e53608f5b297bc986f9143d8193543a7a955fa04d36c3b8764c
MD5 81c1f82f19e5d222db24f83f535bcc39
BLAKE2b-256 8ef9f1755dc059bafdf2d9f483dab2ee10ad7f78fabdb7d33e18174b5fcd71a7

See more details on using hashes here.

Provenance

File details

Details for the file random_ip_generator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for random_ip_generator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9d406644817006ef81c34f5c782c9df048d28df74ede835533ed2afdc046665
MD5 40ce6246edc7820585b64f60d68b0fd2
BLAKE2b-256 d8a98fe131cd93d4fcfb6f0f2d66c2e0978cd26ce3e4b99eba7c4e1f1b363db2

See more details on using hashes here.

Provenance

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