Skip to main content

No project description provided

Project description

packed

License Drone Codecov PyPI 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

packed-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

packed-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file packed-0.1.1.tar.gz.

File metadata

  • Download URL: packed-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for packed-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7af84b3e9fe6092817b2745218b1e9e70919d1ae3ab08bf90f037a3ec3a59fb3
MD5 423020acd40477cc3c19a8c9bb11067b
BLAKE2b-256 f0b720c4765ee629c9059b351c12ea4e39f540b39681f6de79d4861843be38f0

See more details on using hashes here.

File details

Details for the file packed-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: packed-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for packed-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bcee0422d09fb606faa555b1029e9fee5dbdbd7abc520e1a9f69a59e072747fb
MD5 dfec19e3f67d692c151dc1bd09818638
BLAKE2b-256 70380b2bea70eeb7553d4459e98f4e14d4ebd014d66f72cd01306cc9d48a383a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page