Skip to main content

Efficient IP address enumerator that interpolates across IPv4 and IPv6 CIDR ranges

Project description

Netenum

Efficient IP address enumerator that interpolates across IPv4 and IPv6 CIDR ranges without expanding full ranges in memory.

Features

  • Supports both IPv4 and IPv6 CIDR ranges
  • Memory efficient - doesn't expand full ranges
  • Intelligent partitioning based on network size
  • Stripes across multiple networks for balanced enumeration
  • Supports both synchronous and asynchronous iteration
  • Command-line interface with stdin input

Installation

pip install netenum

Usage

Command Line

Enumerate addresses in sequence:

echo "192.168.1.0/24
10.0.0.0/8" | python -m netenum

Enumerate addresses in random order:

echo "192.168.1.0/24
10.0.0.0/8" | python -m netenum -r

You can also use a file:

cat cidrs.txt | python -m netenum

Python API

Synchronous Usage

from netenum import netenum

cidrs = [
    "192.168.0.0/16",          # IPv4
    "2001:db8::/32",           # IPv6
    "224.0.0.0/4",             # IPv4
]

for addr in netenum(cidrs):
    print(addr)

Asynchronous Usage

import asyncio
from netenum import aionetenum

cidrs = [
    "192.168.0.0/16",          # IPv4
    "2001:db8::/32",           # IPv6
    "224.0.0.0/4",             # IPv4
]

async def main():
    async for addr in await aionetenum(cidrs):
        print(addr)

asyncio.run(main())

Development

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest

Format code:

black .
isort .

Type check:

mypy .

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

netenum-0.1.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

netenum-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file netenum-0.1.1.tar.gz.

File metadata

  • Download URL: netenum-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for netenum-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2b9f68e993dcfb1812b1b100d06548039d15bf808941197d8d2ac2cafa1d7064
MD5 78ec82d0e82efb7b3ce10c66a8314f01
BLAKE2b-256 9e5bcf8e4fd31eb8aba00afd8c926efa20b4df3bb7b8b23d40b4f3785ad3e1ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for netenum-0.1.1.tar.gz:

Publisher: publish.yml on paigeadelethompson/python-netenum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netenum-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: netenum-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for netenum-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efe378b64d72fd1cea59c7b01795dc0321a871d71f54fe8d38bd76a26d6a8566
MD5 e3d458fee80fdc8aa8dc5de06e10aa80
BLAKE2b-256 5a57aeecd4b836b4cee79a22532b318b4a42655b1ff677b7b39b7503bfb3a177

See more details on using hashes here.

Provenance

The following attestation bundles were made for netenum-0.1.1-py3-none-any.whl:

Publisher: publish.yml on paigeadelethompson/python-netenum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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