Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

random_prefix_generator-0.4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

random_prefix_generator-0.4-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file random_prefix_generator-0.4.tar.gz.

File metadata

  • Download URL: random_prefix_generator-0.4.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for random_prefix_generator-0.4.tar.gz
Algorithm Hash digest
SHA256 3d601542d47ea221e3bf548c1f961d398a706614d8069ae4cccbecbff57c7c54
MD5 f2bf72eedc6b1e4cdf647898c9ed7b62
BLAKE2b-256 2ac2ee6f0b181dc66d76b3f1c818e8fbab2769a22d25a18300278feb2e07e35a

See more details on using hashes here.

File details

Details for the file random_prefix_generator-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for random_prefix_generator-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eb556e8b1c1c14228d8d6fb8316ebf6f4f08b98ea2f0e35070e54588f6864ef9
MD5 b799d0a2548df35d11add9d1710b9689
BLAKE2b-256 52bd2034488ff367206023bcfa368c73fc5b5573e72c44a6ad98eff69634d59b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page