Skip to main content

packed

Codecov PyPI PyPI - Downloads Python Version

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

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)

Source distribution for packed 0.2.2
File Size Uploaded
packed-0.2.2.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for packed 0.2.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.3

2 release files

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page