Code Monkey home page Code Monkey logo

lzo's Introduction

LZO

Python bindings for LZO data compression library

Install

pip install git+https://github.com/System233/lzo

Examples

import lzo
data=b'0123456789'
encoded=lzo.lzo1.compress(data)
decoded=lzo.lzo1.decompress(encoded,len(data))
print("Test lzo1:",data==decoded)


encoded=lzo.lzo1x.compress_1(data)
# optional
# encoded=lzo.lzo1x.optimize(encoded,len(data))
decoded=lzo.lzo1x.decompress(encoded,len(data))
print("Test lzo1x:",data==decoded)

# thread safe
lzo1z=lzo.Lzo1z()
encoded=lzo1z.compress_999(data)
decoded=lzo1z.decompress(encoded,len(data))
print("Test lzo1z:",data==decoded)

API References

class Lzo1:
    def compress(self,data:bytes)->bytes;
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_99(self,data:bytes)->bytes;

class Lzo1a:
    def compress(self,data:bytes)->bytes;
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_99(self,data:bytes)->bytes;

class Lzo1b:
    BEST_SPEED:int;
    BEST_COMPRESSION:int;
    DEFAULT_COMPRESSION:int;
    def compress(self,data:bytes,level:int)->bytes;
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_99(self,data:bytes)->bytes;
    def compress_999(self,data:bytes)->bytes;
    def compress_1(self,data:bytes)->bytes;
    def compress_2(self,data:bytes)->bytes;
    def compress_3(self,data:bytes)->bytes;
    def compress_4(self,data:bytes)->bytes;
    def compress_5(self,data:bytes)->bytes;
    def compress_6(self,data:bytes)->bytes;
    def compress_7(self,data:bytes)->bytes;
    def compress_8(self,data:bytes)->bytes;
    def compress_9(self,data:bytes)->bytes;

    
class Lzo1c:
    BEST_SPEED:int;
    BEST_COMPRESSION:int;
    DEFAULT_COMPRESSION:int;
    def compress(self,data:bytes,level:int)->bytes;
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_99(self,data:bytes)->bytes;
    def compress_999(self,data:bytes)->bytes;
    def compress_1(self,data:bytes)->bytes;
    def compress_2(self,data:bytes)->bytes;
    def compress_3(self,data:bytes)->bytes;
    def compress_4(self,data:bytes)->bytes;
    def compress_5(self,data:bytes)->bytes;
    def compress_6(self,data:bytes)->bytes;
    def compress_7(self,data:bytes)->bytes;
    def compress_8(self,data:bytes)->bytes;
    def compress_9(self,data:bytes)->bytes;

class Lzo1f:
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_999(self,data:bytes)->bytes;
    def compress_1(self,data:bytes)->bytes;

    
class Lzo1x:
    def compress_1(self,data:bytes)->bytes;
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_dict_safe(self,data:bytes,dst_len:lzo_uint,dict:bytes)->bytes;
    def compress_999(self,data:bytes)->bytes;
    def compress_dict_999(self,data:bytes,dict:bytes)->bytes;
    def compress_level_999(self,data:bytes,level:int,callback_func:object)->bytes;
    def compress_1_11(self,data:bytes)->bytes;
    def compress_1_12(self,data:bytes)->bytes;
    def compress_1_15(self,data:bytes)->bytes;
    def optimize(self,data:bytes,dst_len:lzo_uint)->bytes;

class Lzo1y:
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_1(self,data:bytes)->bytes;
    def compress_999(self,data:bytes)->bytes;
    def decompress_dict_safe(self,data:bytes,dst_len:lzo_uint,dict:bytes)->bytes;
    def compress_dict_999(self,data:bytes,dict:bytes)->bytes;
    def compress_level_999(self,data:bytes,level:int,callback_func:object)->bytes;
    def optimize(self,data:bytes,dst_len:lzo_uint)->bytes;

class Lzo1z:
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_999(self,data:bytes)->bytes;
    def compress_dict_999(self,data:bytes,dict:bytes)->bytes;
    def compress_level_999(self,data:bytes,level:int,callback_func:object)->bytes;
    def decompress_dict_safe(self,data:bytes,dst_len:lzo_uint,dict:bytes)->bytes;
    
class Lzo2a:
    def decompress(self,data:bytes,dst_len:lzo_uint)->bytes;
    def decompress_safe(self,data:bytes,dst_len:lzo_uint)->bytes;
    def compress_999(self,data:bytes)->bytes;

# Default LZO instances
lzo1:Lzo1;
lzo1a:Lzo1a;
lzo1b:Lzo1b;
lzo1c:Lzo1c; 
lzo1f:Lzo1f; 
lzo1x:Lzo1x; 
lzo1y:Lzo1y; 
lzo1z:Lzo1z; 
lzo2a:Lzo2a;

lzo's People

Contributors

system233 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

evanimity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.