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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a05e3cc65fc1473ff5cda1b84871ca38abc28b9d53cec2fbd58352a4ccf920d |
|
MD5 | 651988704d7bd0523a9ba158b14b536b |
|
BLAKE2b-256 | 6842ad77d6c75c73d358edfb4841bc5fe19a98fe289bce8cc895bf3e5dfe30fe |
Close
Hashes for random_prefix_generator-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d0f428a203c6dde032a7ea24f6222ae2ce31d2136c79d2d65f46006f96242aa |
|
MD5 | 9a97a3625f6cd86efe409da9540b2837 |
|
BLAKE2b-256 | 5617f414040e0e0a7aa2fc8be68c0a789dbf337b853ce8f739a2318cb6e0d1b0 |