Giter Site home page Giter Site logo

implode-compression-impls / pkexplode.py Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

This python bindings to libexplode which is a part of pkglib which is a Free Open-Source implementation of PKWare Data Compression Library (DCL) compression format, which itself was ripped out of Ladislav Zezula's StormLib. !!! Migrated to Codeberg ๐Ÿ”๏ธ !!!

Home Page: https://codeberg.org/implode-compression-impls/pkexplode.py

License: MIT License

Python 100.00%
pkware-dcl compression-algorithm decompression decompressor python bindings ctypes

pkexplode.py's Introduction

pkexplode.py

wheel (GitLab) wheel (GHA via nightly.link) GitLab Build Status GitLab Coverage Coveralls Coverage GitHub Actions Libraries.io Status Code style: antiflash License

We have moved to https://codeberg.org/implode-compression-impls/pkexplode.py, grab new versions there.

Under the disguise of "better security" Micro$oft-owned GitHub has discriminated users of 1FA passwords while having commercial interest in success of FIDO 1FA specifications and Windows Hello implementation which it promotes as a replacement for passwords. It will result in dire consequencies and is competely inacceptable, read why.

If you don't want to participate in harming yourself, it is recommended to follow the lead and migrate somewhere away of GitHub and Micro$oft. Here is the list of alternatives and rationales to do it. If they delete the discussion, there are certain well-known places where you can get a copy of it. Read why you should also leave GitHub.


This are free and Open-Source ctypes-based bindings to libexplode which is a ripped out part of pkglib which is a Free Open-Source implementation of PKWare Data Compression Library (DCL) compression format, which itself was ripped out of StormLib, all of which are by Ladislav Zezula.

Alternatively you can use:

  • pkblast.py, a wrapper to Mark @madler Adler's libblast - another free and open-source implementation of PKWare DCL decompressor.

  • pwexplode - a pure-python impl. โš ๏ธโš ๏ธโš ๏ธ WARNING GPL-3.0-or-later โš ๏ธโš ๏ธโš ๏ธ

You also can be interested in the compression counterpart, pkimplode.py

Benefits of CTypes-based impl:

  • Supports python versions other than CPython
  • No need to recompile python module after python version upgrade

Drawbacks:

  • performance and overhead may be worse, than in the case of a cext.

Installation

In order to make it work you need a package with libexplode itself installed into your system using your distro package manager. If your distro doesn't provide one, you can build it yourself using CMake CPack from the sources by the link. You will get 3 packages, one with the headers and another one with the shared library. Only the one with the lib is mandatory.

Usage

The package contains multiple functions. They have names matching the regular expression ^decompress(Stream|Bytes(Whole|Chunked))To(Stream|Bytes)$.

The first subgroup describes the type of input argument, the second subgroup describes the type of output.

  • If input is Bytes, then you need
    • Whole, which means that the lib gots a pointer to whole array with compressed data. This is considered to be the optimal input format.
    • Chunked (which means the data are processed in reality by decompressStreamTo$3) was created mainly for convenience of testing.
  • Otherwise it is an object acting like a stream. In this case you can also provide chunkSize, because streams are processed in chunks. Larger the chunk - less the count of chunks in the stream, so less overhead on calls of callbacks, but more memory is needed to store the chunk.

The second subgroup describes the type of the result.

  • The internal type of the result is always a Stream. This is considered to be the optimal output format. It is because we don't know the size of output ahead of time, so have to use streams.
  • Bytes are only for your convenience and just wrap the decompress$1ToStream with a context with BytesIO.

pkexplode.py's People

Contributors

kolanich avatar

Watchers

 avatar

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.