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.3.tar.gz (2.0 MB view hashes)

Uploaded Source

Built Distribution

random_ip_generator-0.1.3-py3-none-any.whl (2.0 MB view hashes)

Uploaded Python 3

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