Skip to main content

databind.binary

Databind is a library inspired by Jackson-databind to describe and bind data models for object-oriented programming. The databind.binary package implements conversion of data models between Python and binary format (using the struct module).

Todo

  • Support (efficient) unpacking of nested structs

Quickstart

from databind.binary import to_bytes, calc_size, cstr, u32
from databind.core import datamodel, field

@datamodel
class RiffChunk:
  """ RIFF-WAVE chunk header. """
  chunk_id: cstr = field(default=b'RIFF', metadata={'size': 4})
  chunk_size: u32
  riff_type: cstr = field(default=b'WAVE', metadata={'size': 4})

assert calc_size(RiffChunk) == 12
assert to_bytes(RiffChunk(chunk_size=16442)) == b'RIFF:@\x00\x00WAVE'

Copyright © 2020 – Niklas Rosenstein

Metadata

Release files for databind.binary 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for databind.binary 0.2.1
File Size Uploaded
databind.binary-0.2.1.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for databind.binary 0.2.1
File Interpreter ABI Platform
databind.binary-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / databind.binary-0.2.1.tar.gz

Download URL databind.binary-0.2.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
13f15176764c024734da0ca34601c611fefefb8877a3052df25c122fc809988b
BLAKE2b-256 checksum
How to use checksums
04e350f2bff80604df27156afbf7f92dcababa6d5cdc9290ad26cc859399fb2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Release files / databind.binary-0.2.1-py3-none-any.whl

Download URL databind.binary-0.2.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5be3549603880c56630b1a62588c5ee6dcf2412c66b91d7bbac381c1706913d
BLAKE2b-256 checksum
How to use checksums
414551e1d1918b302d38d4ca6827ad38a318b467cd41de219746f9123627ad28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 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