A package for generating random IPv4 and IPv6 addresses and subnets
Project description
Random IP/Prefix Generator
randomprefixgenerator
is a simple Python module for generating random IPv4 and IPv6 addresses and subnets.
Features
- Generate random IPv4 or IPv6 addresses.
- Generate random IPv4 or IPv6 subnets with a specified prefix length.
- Control the range of prefix lengths for generated subnets.
Installation
You can install myIp using pip:
pip install randomprefixgenerator
Usage
from randomprefixgenerator import RandomPrefixGenerator
# Create a new myIp object for generating IPv4 addresses
ipv4_gen = RandomPrefixGenerator(4, mode='ip')
# Generate a random IPv4 address
ipv4_addr = next(ipv4_gen)
# Create a new myIp object for generating IPv6 subnets with prefix lengths between 64 and 120
ipv6_gen = RandomPrefixGenerator(6, mode='prefix', min_length=64, max_length=120)
# Generate a random IPv6 subnet
ipv6_subnet = next(ipv6_gen)
Dependancies
- Python 3.x
ipaddress
modulerandom
module
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for random_prefix_generator-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 514027d622a0975a375f06a4ed8fdce346ee6bf91c9458da51195b3d1d989d92 |
|
MD5 | 36d76ea43cb4afb5d920e728ec7ea3a8 |
|
BLAKE2b-256 | 641b8567cde09dd9c85545dbae47700b831a3fb4a425a1fced3651b6a675b690 |
Close
Hashes for random_prefix_generator-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe687bf3ba4a8945243b6e98998201703e13f105759e1fad57da3f3a962f6143 |
|
MD5 | ee6f95d65d883f1331dd372ac21cac6b |
|
BLAKE2b-256 | 17c201baa99bf0c36f8393b3dc4903bb3bc1c401302ba62107c445d4922b126c |