packed
Installation
pip3 install packed
Usage
from packed import packable
@packable # 1) register class
class EqualMatcher:
def __init__(self, expected):
self._expected = expected
def match(self, actual):
return actual == self._expected
def __packed__(self): # 2) pick fields
return {"expected": self._expected}
client
from packed import pack
matcher = EqualMatcher("banana")
packed = pack(matcher)
# -> send «packed» over network
server
from packed import unpack
# <- recieve «packed» as binary
matcher = unpack(packed)
assert matcher.match("banana") is True
Metadata
Release files for packed 0.2.2
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 | |
|---|---|---|---|---|
| packed-0.2.2.tar.gz | 7.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| packed-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / packed-0.2.2.tar.gz
| Download URL | packed-0.2.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a23bec8c17beafbbac796965c54ad6ab532b4b96c7a00242dbaaa2d153a9df7b
|
|
BLAKE2b-256 checksum How to use checksums |
7e99ae79b10ace5914ff2fd5c3c28592a11cad2fa77ac92b030e6a749dcdb365
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / packed-0.2.2-py3-none-any.whl
| Download URL | packed-0.2.2-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbeb4be842672bef7751f92159b6a08210b173a82c1ccbe7ffab22455f386c42
|
|
BLAKE2b-256 checksum How to use checksums |
3e8f6cb2bc4009c862bdda1d3708e9cb45027014e3f4596726c113198fc58cfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Security for packed 0.2.2
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.