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.2.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

random_ip_generator-0.1.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: random-ip-generator-0.1.2.tar.gz
  • Upload date:
  • Size: 14.3 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.2.tar.gz
Algorithm Hash digest
SHA256 28a5abcb54bc87e3b4f23a1856a1192a38138d00b32b6828f5394f67125b1b44
MD5 0466719d3e40a87a42c8ba672bdfc940
BLAKE2b-256 589295775a3aff35fd924588ec9443ba9f57f885a606ac160388d2f24591a1a0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for random_ip_generator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bae2a0f96722f31b451715464e1af6ac92fa90941d890b4e4b74048f8628bd88
MD5 0a5b3fea348c5e7a2637b6ca69c90739
BLAKE2b-256 9f01bd4fc303db3a0be667bae4e33a28a25c1aacac1e24f70b9c01099b114cc4

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