Skip to main content

Compact binary serialization format

Project description

MicroBIN python library

MicroBIN is a compact binary serialization format.

More info about MicroBIN format

Installing

# Linux
pip install microbin

# Windows
py -3 -m pip install microbin

Usage

Use as library

MicroBIN library provides json-like interface with load(s) and dump(s) functions.

Command line utilities

Note. For windows use py -3 -m ... instead of python -m ... .

mbstat

$ python -m microbin.mbstat -h
usage: microbin.mbstart [-h] [-V] [-s {count,size,bpo}] file

Analyze MicroBIN file

positional arguments:
  file                  MicroBIN file to analyze

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -s {count,size,bpo}, --sort {count,size,bpo}
                        set field to sort (default: size)

(c) NekoNekoNyan <me@neko-dev.ru>, 2023

mb2json

$ python -m microbin.mb2json -h
usage: microbin.mb2json [-h] [-V] [-o OUTPUT] [-m MAGIC] [-c] [-a] file

Convert MicroBIN file to json

positional arguments:
  file                  MicroBIN file to convert

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -o OUTPUT, --output OUTPUT
                        set output json file (default: standart output)
  -m MAGIC, --magic MAGIC
                        set application magic (default: 0000)
  -c, --compact         create compact json
  -a, --ascii           create json without any non-ascii characters

(c) NekoNekoNyan <me@neko-dev.ru>, 2023

json2mb

$ python -m microbin.json2mb -h
usage: microbin.json2mb [-h] [-V] [-i INPUT] [-m MAGIC] [-f {16,32,64}] file

Convert json to MicroBIN file

positional arguments:
  file                  output MicroBIN file

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -i INPUT, --input INPUT
                        set input json file (default: standart input)
  -m MAGIC, --magic MAGIC
                        set application magic (default: 0000)
  -f {16,32,64}, --float-size {16,32,64}
                        set size of float numbers (in bits; default: 64)

(c) NekoNekoNyan <me@neko-dev.ru>, 2023

License

MIT License. See here for more info

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

microbin-1.0.1.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

microbin-1.0.1-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

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