Skip to main content

parviflora is a binary exchange format

Permuatio uses a binary format called parviflora. This is a python implementation of said format.

Usage

The module exports main 2 methods write_msg and read_msg, as well as their safe (non-exception throwing) counterparts safe_write_msg and safe_read_msg.

Documentation:

write_msg

Takes 2 argumentss

  • file: a BufferedWriter that can have binary values write to
  • obj: one of the types that parviflora can represent, that will be writen

safe_write_msg

Takes 2 argument:

  • filename: a filename that the file should be written to, should there not be issues with writing the value
  • obj: as in above

It also returns 1 value: Either None or str which is an error string

read_msg

Takes 1 argument:

  • file: a BufferedReader that can have binary values read from

It also returns 1 value: an object that has been read from the file.

safe_read_msg

Takes 1 argument:

  • filename: a filename that the file should be read from

It also returns 1 value: an object that has been read from the file or an error.

Example

import binformat

safe_write_msg("hexxy", {
    1: b"Hello world",
    2: [1, 2, 3]
})

with open("hexxy", "rb") as f:
    print(read_msg(f))
    # { 1: b"Hello world", 2: [1, 2, 3] }

Testing

Run tests.py

Release files for parviflora 1.0.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 parviflora 1.0.1
File Size Uploaded
parviflora-1.0.1.tar.gz 14.9 kB Details

Built distribution (wheel)

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

Total release size: 29.8 kB

Release files / parviflora-1.0.1.tar.gz

Download URL parviflora-1.0.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2ae06cffe90c7a31b4bd9eba9044f34dad89445408a3cc08c54c5556def05930
BLAKE2b-256 checksum
How to use checksums
dfe3ab0c5e23394c66a7108e4cd3eb497ebbe54d2ff9ba5c452285509e7e78d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.9 Darwin/22.2.0

Release files / parviflora-1.0.1-py3-none-any.whl

Download URL parviflora-1.0.1-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
256b850162c50fb237eeee107ed7ef06eb80827b13838a852672502cd2dd72db
BLAKE2b-256 checksum
How to use checksums
df12a5bd2d1076ec99c219f89fdb633d1fcbb6acce9e474d613d5e5304c9d51f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.9 Darwin/22.2.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.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