Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
/ py_zbg Public archive

Python implementation for zbg encoding and filetype.

License

Notifications You must be signed in to change notification settings

Muterra/py_zbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zbg

Python library for zbg encoding.

Installation

>>> pip install zbg

Use

Please see the ZBG standard for details on what objects are supported. The short version is you may serialize anything consisting of only:

  • Lists
  • Dictionaries
  • Arbitrary binary

In this particular implementation, to be correctly interpreted, the corresponding python entities should be compatible with:

  • Mutable sequence (see containers.abc.MutableSequence)
  • Mapping (see containers.abc.Mapping)
  • Bytes-like objects (support the buffer protocol)

dump(obj): serializes the entire obj. Object must be as described above. Returns bytes.

dumpf(obj, f): Serializes the obj to a standalone file. f is the open file handle to output to. dumpf will not call close(). f should be opened with mode 'w+b'.

load(zbg): Loads a zbg-serialized bytes-like object into memory. Returns an object corresponding to whatever was contained within zbg.

loadf(f): Loads a standalone zbg-serialized file from f. Returns an object corresponding to whatever was contained within zbg. f should be opened with mode 'rb' and will not be closed by the load.

About

Python implementation for zbg encoding and filetype.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages