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
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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d601542d47ea221e3bf548c1f961d398a706614d8069ae4cccbecbff57c7c54 |
|
MD5 | f2bf72eedc6b1e4cdf647898c9ed7b62 |
|
BLAKE2b-256 | 2ac2ee6f0b181dc66d76b3f1c818e8fbab2769a22d25a18300278feb2e07e35a |
Close
Hashes for random_prefix_generator-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb556e8b1c1c14228d8d6fb8316ebf6f4f08b98ea2f0e35070e54588f6864ef9 |
|
MD5 | b799d0a2548df35d11add9d1710b9689 |
|
BLAKE2b-256 | 52bd2034488ff367206023bcfa368c73fc5b5573e72c44a6ad98eff69634d59b |