The one and only library to make your network code handsome
Project description
A Python library for working with common networking types and conversions, including IPv4 addresses/networks, MAC addresses, BGP ASNs, VLANs and network interfaces.
Installation
pip install netsome
Features
- IPv4 address and network manipulation (addresses, networks, interfaces)
- MAC address handling (MAC-48/EUI-48)
- BGP AS number conversions (asplain, asdot, asdotplus formats)
- VLAN ID validation and management
- Network interface name parsing and standardization
- Robust validation for all data types
- Type-safe implementation with proper error handling
Basic Usage
from netsome.types import IPv4Address, IPv4Network, MacAddress, ASN, VID
# Create and manipulate IPv4 addresses
addr = IPv4Address("192.168.1.1")
net = IPv4Network("192.168.1.0/24")
# Work with MAC addresses
mac = MacAddress("00:11:22:33:44:55")
print(mac.is_unicast()) # True
print(mac.oui) # "001122"
# Handle BGP AS numbers
asn = ASN.from_asdot("64512.1")
print(asn.to_asplain()) # "4244897793"
# Manage VLAN IDs
vid = VID(100)
print(vid.is_reserved()) # False
Authors
- Dmitriy Kudryavtsev - author - kuderr
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
netsome-0.3.22.tar.gz
(11.5 kB
view details)
Built Distribution
netsome-0.3.22-py3-none-any.whl
(15.9 kB
view details)
File details
Details for the file netsome-0.3.22.tar.gz
.
File metadata
- Download URL: netsome-0.3.22.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.1 CPython/3.12.2 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceeef4262757a537f9b0cb55ddce884c496ac7a638c46764843aa1ef27da256f |
|
MD5 | 77d7a1c4947debe38ad0372c7bd09a71 |
|
BLAKE2b-256 | 938c892db07821209c994e302cb245cfe3a127fb76a5efcc6aa328215777b860 |
File details
Details for the file netsome-0.3.22-py3-none-any.whl
.
File metadata
- Download URL: netsome-0.3.22-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.1 CPython/3.12.2 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e3a4517dbcc6ddf62b2a56083de0715341e11e71329470739a390ae96d01c9f |
|
MD5 | cac0b1d1225b9b85987bc4d12e124eff |
|
BLAKE2b-256 | eec0ec7cc946bf1ed2fea17dc6763ac5be2d7bc71a4ffb5f204e1351f508c90c |