Expands networks given in CIDR, dashed, or splat format.
Project description
netexpand
Expands networks given in CIDR, dashed, or splat format.
netexpand takes a given network (which can be notated with CIDR, dashed, or splat format) and expands the network; i.e., it prints each valid address within the network given.
Supported Notations:
- CIDR:
x.x.x.x/x(e.g.,192.168.1.0/24) - Dashed:
x.x.x.x-x(e.g.,192.168.1.1-254) - Splat:
x.x.x.*(e.g.,192.168.1.*)
NOTE: Network notations should not be mixed; the program will report an error and exit upon detection.
By default, the tool prints each valid host address to stdout. It also includes options to randomize the output addresses and to select specific network components (like network addresses or broadcast addresses).
Installation
Requires a current Python 3.7+ installation with standard libraries.
Install from PyPI (Recommended):
pip install netexpand
Install from Source:
git clone https://github.com/sjtrotter/netexpand.git
cd netexpand
pip install .
Usage Example
Once installed, you can call netexpand natively from anywhere in your terminal.
Standard Host Expansion (Default):
$ netexpand 192.168.1.0/30
192.168.1.1
192.168.1.2
Randomized Output:
$ netexpand 192.168.1.10-15 -r
192.168.1.14
192.168.1.11
192.168.1.15
192.168.1.10
192.168.1.12
192.168.1.13
Output Specific Network Components:
You can specify whether you want to output hosts, networks, or broadcast addresses using the -t or --type flag.
$ netexpand 10.0.0.* -t broadcast
10.0.0.255
Development Setup
To work on netexpand locally without needing to reinstall after every change, install the package in "editable" mode:
git clone https://github.com/sjtrotter/netexpand.git
cd netexpand
pip install -e .
Acknowledgements
- Parts of this codebase, including refactoring and CI/CD pipeline generation, were developed with the assistance of an AI language model (Gemini 3.1 Pro).
Meta
Stephen Trotter – stephen@trotter.cloud
Distributed under the GNU GPLv3 license. See LICENSE for more information.
https://github.com/sjtrotter/netexpand
Contributing
- Fork it (https://github.com/sjtrotter/netexpand/fork)
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netexpand-0.9.0.tar.gz.
File metadata
- Download URL: netexpand-0.9.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70136629fa4e7090b8ec2c451a1adfd5be0aa88dd08a21be9542ef3b882c8773
|
|
| MD5 |
b8c76b95020f8be0f22b3e17769ced29
|
|
| BLAKE2b-256 |
4d084fd867149993234ac54a2c1d2f29cdcc78752433488258c44b9a1943c044
|
Provenance
The following attestation bundles were made for netexpand-0.9.0.tar.gz:
Publisher:
python-publish.yml on sjtrotter/netexpand
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netexpand-0.9.0.tar.gz -
Subject digest:
70136629fa4e7090b8ec2c451a1adfd5be0aa88dd08a21be9542ef3b882c8773 - Sigstore transparency entry: 1252737452
- Sigstore integration time:
-
Permalink:
sjtrotter/netexpand@c0288ed6e602cb8e09ccc13abe11acd0bde504c5 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/sjtrotter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c0288ed6e602cb8e09ccc13abe11acd0bde504c5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file netexpand-0.9.0-py3-none-any.whl.
File metadata
- Download URL: netexpand-0.9.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce2f7576ec57ae59e9dc432658a545913c2d95283a0d548093169c1b73f2f4b9
|
|
| MD5 |
bb51c9b03c00c4bf88843075f7ca1f86
|
|
| BLAKE2b-256 |
55635b348431885839d229835ba255580e77699ca0e82564443bcfc328fc65ec
|
Provenance
The following attestation bundles were made for netexpand-0.9.0-py3-none-any.whl:
Publisher:
python-publish.yml on sjtrotter/netexpand
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netexpand-0.9.0-py3-none-any.whl -
Subject digest:
ce2f7576ec57ae59e9dc432658a545913c2d95283a0d548093169c1b73f2f4b9 - Sigstore transparency entry: 1252737579
- Sigstore integration time:
-
Permalink:
sjtrotter/netexpand@c0288ed6e602cb8e09ccc13abe11acd0bde504c5 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/sjtrotter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c0288ed6e602cb8e09ccc13abe11acd0bde504c5 -
Trigger Event:
push
-
Statement type: