NetState
NetState is a Python package for collecting structured system and network information on Windows machines.
It provides a clean API to retrieve:
- Operating system details
- Active private network adapter information
- Public IP and ISP information
- JSON-serializable network snapshots
This package is intended to be used as a library, not a standalone application.
Installation
After publishing to PyPI:
pip install netstate
For local development:
pip install -e .
Basic Usage
from netstate.network_info import get_network_info
snapshot = get_network_info()
print(snapshot.system)
print(snapshot.private_network)
print(snapshot.public_network)
JSON Output
from netstate.network_info import get_network_info_json
json_output = get_network_info_json()
print(json_output)
Returned Data Structure
get_network_info() returns a NetStateSnapshot dataclass containing:
- platform (str)
- system (SystemData)
- private_network (List[NetworkData] | None)
- public_network (PublicNetworkData | None)
- record_time (datetime)
All models are defined using Python dataclasses.
Requirements
- Python 3.9+
- Windows OS
- requests
Design Goals
- Clean modular architecture
- Structured dataclass models
- Graceful failure handling
- Easy JSON serialization
- Extensible collector design
License
MIT License
Author
Imon Mallik
Metadata
Release files for netstate 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| netstate-0.1.0.tar.gz | 6.9 kB | Without provenance | Details for netstate-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netstate-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for netstate-0.1.0-py3-none-any.whl |
Total release size: 14.4 kB
Release files / netstate-0.1.0.tar.gz
| Download URL | netstate-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24b6d3de0ad63cac7845a6d33dce1dff10cb958dc6d908fbddbcab9b628ed924
|
|
BLAKE2b-256 checksum How to use checksums |
5dc796c4bbe41e02d847d04ca8124660d84086a778bd0b45ea9037cfde8891b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / netstate-0.1.0-py3-none-any.whl
| Download URL | netstate-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e41df17198e5af8d23ce8ac7541599ae726929e83ace2bad0c85967ab10cc17
|
|
BLAKE2b-256 checksum How to use checksums |
5e9eb9eb889a5c782386cc0aec0be363d4a4e826090a5cd3160357fa68be8c0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for netstate 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.