Cain

Latest version: v1.1.1

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.1

> Performance update

After profiling extensively[^1] and using `cain` at a larger scale for a while (see [`translatepynext`](https://github.com/Animenosekai/translate/tree/next) for more information), this is an update bringing better performance in decoding using the `cain` data format. (this was enough to be able to see a 1.5~2x performance improvements during decoding)

New

- Added an `Enum` datatype

Updates

- Adding examples in datatypes docstring
- Using `Datatype._cain_value` instead of `Datatype.` to avoid conflicting attributes
- Using `Datatype.__root__` instead of `Datatype.origin` to avoid conflicting attributes
- Speeding up annotations parsing (introducing `DatatypeMeta.__type_hints__`)
- Using the current `Object` instead of the built-in `dict` for the decoding result
- Other minor performance improvements

Everything is detailed in the [`README.md`](./README.md) file

A comparison from the previous release can be found here [`v1...v1.1`](https://github.com/Animenosekai/cain/compare/v1...v1.1)

A comparison from the current branch can be found here [`v1.1...main`](https://github.com/Animenosekai/cain/compare/v1.1...main)

[^1]: Profiled using tools: [`cProfile`](https://docs.python.org/3/library/profile.html#module-cProfile), [`pyinstrument`](https://github.com/joerick/pyinstrument) and [`line_profiler`](https://github.com/pyutils/line_profiler)

> 🍡 Animenosekai


v1
First release for `cain`!

1.0

Welcome to `cain`, your new way of formatting data!

Cain is a new data interchange format which aims at providing the smallest possible size to encode data.

It is based on pre-defined schemas, which leverages the need to specify it within the final encoded data.

Features
- Encode using the `cain` data format
- Decode using the `cain` data format
- Encode schemas
- Decode schemas
- Complete CLI
- CLI tests
- Extensibility with custom encoders

Everything is detailed in the [`README.md`](./README.md) file

> ✨Animenosekai

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.