pysecnet
Lightweight Python networking toolkit. Zero dependencies. Standard library only.
Installation
pip install pysecnet
Modules
subnet - Subnet Calculations
from pysecnet.subnet import cidr_to_mask, mask_to_cidr, subnet_info
cidr_to_mask(24) # '255.255.255.0'
mask_to_cidr("255.255.255.0") # 24
subnet_info("192.168.1.100", 24)
# {'network': '192.168.1.0', 'broadcast': '192.168.1.255',
# 'mask': '255.255.255.0', 'prefix': 24, 'usable_count': 254, ...}
port - Port Scanning
from pysecnet.port import check_port, service_name, scan_range
check_port("example.com", 80) # True if open
service_name(443) # 'HTTPS'
scan_range("192.168.1.1", 1, 1024) # [(port, service), ...]
dns - DNS Lookups
from pysecnet.dns import resolve_a, reverse_lookup, resolve
resolve_a("example.com") # ['93.184.216.34']
reverse_lookup("8.8.8.8") # 'dns.google'
resolve("example.com") # '93.184.216.34'
ping - ICMP Ping
from pysecnet.ping import ping, ping_ok
result = ping("8.8.8.8")
# {'alive': True, 'avg_rtt': 12.5, 'packet_loss': 0.0, ...}
ping_ok("8.8.8.8") # True
mac - MAC Address Utilities
from pysecnet.mac import validate, vendor, is_multicast
validate("00:11:22:aa:bb:cc") # '00:11:22:aa:bb:cc'
vendor("00:0C:29:AA:BB:CC") # 'VMware'
is_multicast("01:00:5E:00:00:01") # True
http - HTTP/SSL Utilities
from pysecnet.http import get_headers, status_code, ssl_info
get_headers("https://example.com") # {'status_code': 200, 'server': '...', ...}
status_code("https://example.com") # 200
ssl_info("example.com") # {'subject': '...', 'issuer': '...', ...}
utils - Validation Utilities
from pysecnet.utils import validate_ip, parse_cidr, is_private_ip
validate_ip("192.168.1.1") # True
parse_cidr("10.0.0.0/24") # ('10.0.0.0', 24)
is_private_ip("10.0.0.1") # True
License
MIT
Metadata
Release files for pysecnet 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pysecnet-1.0.0.tar.gz | 13.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pysecnet-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.9 kB
Release files / pysecnet-1.0.0.tar.gz
| Download URL | pysecnet-1.0.0.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73cd596b471976c7c80abe26a91db1fdea5462bab6da948019cfacf7455f33fe
|
|
BLAKE2b-256 checksum How to use checksums |
45fc3bb78dbc13c2b1c635c7948f5d1b93718d1500d94d1af442ea3e5150e10a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / pysecnet-1.0.0-py3-none-any.whl
| Download URL | pysecnet-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1a49dbcd3e65b352bf3ac3a90c43fb2cf4d9403a1dc67ffd0358ee503206b74
|
|
BLAKE2b-256 checksum How to use checksums |
1de4b40bc97dd8cac9297207cb32b54433cd5038e5f1838069b83277e2ddfe98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|