Skip to content

hmcq6/pyleon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyLEON

This is an implementation of LEON serialization for Python. The "leon" module exposes two functions, "loads" and "dumps" which works exactly like json.loads and json.dumps. In addition to these functions, the module exposes a "Channel" class which you can construct by passing a template of the data to be sent, the same as how it works in the JavaScript implementation. The list of different types is in the "leontypes" module.

Install

$ python setup.py install

Usage

::

from pyleon import leon from pyleon import leontypes

obj = {'key': 5, 'otherkey': 6, 'thirdkey': 7} serialized = leon.dumps(obj) // u'x00x03thirdkeyx00otherkeyx00keyx00x00x01x00x03x00x01x02tx00x00x07x00x06x00x05' leon.loads(serialized) == obj // True

channel = leon.Channel({'key': leontypes.CHAR, 'otherkey': leontypes.CHAR, 'thirdkey': leontypes.CHAR}) serialized = channel.dumps(obj) // u'x05x06x07' channel.loads(serialized) == obj // True

About

LEON serialization for Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%