pnet
A fast and simple packet creation and parsing lib for Python, currently nothing more then a proof of concept. Inspired by both the python pypacker library and Rust’s pnet,
Design
Built around trying to minimize copying data by taking advantage of memoryviews for fast slicing and zero copy memory operations.
This library takes either a bytes or bytearray object and parses out various protocols in a similar fashion to the Rust library. The resulting packet objects can be inspected, or, in the case its backed by a bytearray, also written to. In this case, the backing memory is immediately updated.
Instead of mapping packet fields to attributes, I expose them instead with a collection-like API. This is my personal taste, as I don’t like how autogenerated attributes end up with akward names that can overlap with Python keywords.
Performance
Initial testing on my machine has shown that this library is about twice as fast at parsing packets, but I haven’t determined yet if this can be attributed to design differences, or if I’m just simply doing less.
TODO
This is one part of a slew of network inspecting code I’m releasing.
rich BPF support and mini-language
asyncio support for raw sockets and packet capturing
asyncio based dhcp server and client library
Metadata
Release files for pnet 0.0.1
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 |
|---|---|---|---|---|
| pnet-0.0.1.tar.gz | 9.6 kB | Without provenance | Details for pnet-0.0.1.tar.gz |
Release files / pnet-0.0.1.tar.gz
| Download URL | pnet-0.0.1.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16bbc1c550c7170b4990a6bee33921c093e1df59a8e57aa0e09d15a76d621a02
|
|
BLAKE2b-256 checksum How to use checksums |
c3a326e2a4b1998a76ad846ffcf403f60231adda327412e321a4f535a74dd9c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pnet 0.0.1
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.