Giter Site home page Giter Site logo

kolanich-libs / transformerz.py Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 32 KB

A library implementing composable and stackable reversible processor objects for data. !!! Migrated to Codeberg ๐Ÿ”๏ธ !!!

Home Page: https://codeberg.org/KOLANICH-libs/transformerz.py

License: The Unlicense

Python 92.04% Shell 0.50% Jupyter Notebook 7.46%
transformations invertible serialization compression json msgpack cbor bson yaml python

transformerz.py's Introduction

transformerz.py Unlicensed work

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

We have moved to https://codeberg.org/KOLANICH-libs/transformerz.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 and wide adoption 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.


Just a set of composable processor objects that can be stacked, and path can be automatically routed.

Each class/object has 2 members of type type:

  • tgtType
  • srcType

and 2 functions

  • process - converts a value of srcType to the tgtType. Should parse the data from the representation useful for storing on disk.
  • unprocess - converts a value of tgtType to srcType Should serialize the data from the representation useful for storing on disk. .

The names of functions are inherited from kaitai.process library (Kaitai Struct is a parsing framework, so process historically means parsing), so are some classes (and I hope to get the stuff from this package merged supported by KS somewhen).

There are 3 base classes:

  • TransformerBase - for objects with srcType and tgtType hardcoded in class definitions or available as props
  • Transformer - for objects with srcType and tgtType stored in slots
  • FileTransformer - for transformations when unprocessed form can be stored in a file with a well-known extension and possible MIME type.
  • BinaryProcessor - adapter for Kaitai Struct stuff

There are transformers are of different types and reside in different submodules:

  • .serialization - packages to serialize various objects
    • .json.jsonSerializer - Uses ujson if it is available which is faster than built-in json module.
    • .bson.bsonSerializer - Available if pymongo is installed.
    • .msgpack.msgpackSerializer - Available if a package for MsgPack serialization is installed.
    • .cbor.cborSerializer - Available packages for CBOR serialization: either cbor or cbor2 - are installed.
    • .pon.ponSerializer - "Python Object Nonation" - stuff like JSON that can be safely evaluated using literal_eval
  • .processors - process binary data. This module contains the adapters allowing to use the stuff written to be used in process attr in Kaitai Struct specs.
  • .compression - packages to compress binary data. Take various params.
  • .text - convert text to bytes and back
  • .struct - parses data to tuples and back using struct.Struct. Numbers binary representations also go here. But not all. Some cannot be parsed by struct, so they go to ...
  • .numpy - parsing and serializing arrays of numbers using numpy machinery. Mostly needed for IEEE 751 floats not built into python.

Tutorial

The tutorial is available. tutorial.ipynb NBViewer

transformerz.py's People

Contributors

kolanich avatar

Watchers

 avatar  avatar

transformerz.py's Issues

Add more compressors

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.