Metadata-Version: 2.1
Name: microbin
Version: 1.0.1
Summary: Compact binary serialization format
Project-URL: Homepage, https://github.com/neko-neko-nayn/python-microbin
Project-URL: Issues, https://github.com/neko-neko-nayn/python-microbin/issues
Author-email: NekoNekoNyan <me@neko-dev.ru>
License: MIT License
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# MicroBIN python library

MicroBIN is a compact binary serialization format.

[More info about MicroBIN format](https://github.com/neko-neko-nyan/MicroBIN)

# Installing

```bash
# 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](https://github.com/neko-neko-nyan/python-microbin/blob/main/LICENSE)
