Skip to main content

A python package and commandline tool for generating IPv4-addresses based on a schema.

Project description

ipranger Logo

made-with-python PyPI GitHub

A python package and commandline tool for generating IPv4-addresses based on a schema.

Setup

ipranger can be installed either by using pip or by pulling the source code from this repository:

# Install using pip
pip3 install ipranger

Overview

This section provides an overview of the individual ways to interact with ipranger.

Command Line

ipranger can be directly used via the commandline and as such included in bash-scripts for advanced IPv4 address format processing.

# Print IPv4 subnet
$ ipranger 192.0.0.1/29
192.0.2.1
192.0.2.2
...
192.0.2.6

# Ranges, comma separated values and IPv4 addresses
$ ipranger 192.168.2.1,2,192.168.2.3,4,5-6
192.0.2.1
192.0.2.2
...
192.0.2.6

# Exclude IPv4 addresses
$ ipranger 192.168.2.1-6 --exclude 192.168.2.2
192.0.2.1
192.0.2.3
...
192.0.2.6

Package

ipranger can be used via the custom argparse type ip_addresses_type:

import argparse
from ipranger.ipranger import ip_addresses_type
parser = argparse.ArgumentParser(description='Scan IPv4 addresses')
parser.add_argument('ip_addresses', type=ip_addresses_type,
                    help="List of IPv4 addresses e.g. '192.168.0.1' '192.168.0.1,3-20', '192.168.0.1/24'")
arguments = parser.parse_args()
for ip_address in arguments.ip_addresses:
    print(ip_address)

Another way to interact with ipranger in python programs is by importing the generate method:

from ipranger.ipranger import generate
for ip_address in generate(include_list=['192.168.0.1-6'], exclude_list=['192.168.0.2']):
    print(ip_address)

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

ipranger-1.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

ipranger-1.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file ipranger-1.1.0.tar.gz.

File metadata

  • Download URL: ipranger-1.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for ipranger-1.1.0.tar.gz
Algorithm Hash digest
SHA256 312b811b87a7db033be603f287f6fc1941c3e05ccf669a8026dde896c77a8a4a
MD5 d75a76242c45d84b7cdf58ee31dae58c
BLAKE2b-256 6cb5bc3dfe216eda4fafdd8141f996bc1ecf67204b881bdb93c7f30518b264c6

See more details on using hashes here.

File details

Details for the file ipranger-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ipranger-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for ipranger-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3484ee4e4065ab4dfe1a58d5ae2ebf72c243058e5a4d0fa640a416e93fcbe962
MD5 9f149b1c3024dd4e15663e594761f79f
BLAKE2b-256 9660d8ff013dd7a7eb977b6381d970f7b519681a85181741b1e5331017dd0a91

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