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 nmap-like format.

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 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 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.2.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.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ipranger-1.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 04db50455520765421d0892dbe7622d9bf0b79c9f3153ad5e0540811cd8312d9
MD5 4816dc2eec19d2f2aaf08cc9c8dbf923
BLAKE2b-256 ec5c87204d85273dad2587ed907b0ec6cdd3c92c51ea2a2c57f13c58e7e885d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ipranger-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c04b8c33b3eaabc381df8e6b6891c6077658e43b9d801c832847627f0b4d731a
MD5 701c4c63159d07ffdc78f60edeeddc39
BLAKE2b-256 49f2b7c27612e63dd2abd074f523da08e52c4449ba1ef80fa313c504c30d00ec

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