Import python venv for stability

This commit is contained in:
2026-02-15 21:24:16 -08:00
parent 1343e93a59
commit 7d784705c9
4997 changed files with 1628270 additions and 0 deletions
@@ -0,0 +1,156 @@
Metadata-Version: 2.4
Name: cramjam
Version: 2.11.0
Requires-Dist: black==22.3.0 ; extra == 'dev'
Requires-Dist: numpy ; extra == 'dev'
Requires-Dist: pytest>=5.30 ; extra == 'dev'
Requires-Dist: pytest-xdist ; extra == 'dev'
Requires-Dist: pytest-benchmark ; extra == 'dev'
Requires-Dist: hypothesis==6.60.0 ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: Thin Python bindings to de/compression algorithms in Rust
Keywords: compression,decompression,snappy,zstd,bz2,gzip,lz4,brotli,deflate,blosc2
Author: Miles Granger <miles59923@gmail.com>
Author-email: Miles Granger <miles59923@gmail.com>
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: homepage, https://github.com/milesgranger/pyrus-cramjam
Project-URL: documentation, https://docs.rs/cramjam/latest/cramjam
Project-URL: repository, https://github.com/milesgranger/pyrus-cramjam
# cramjam
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![CI](https://github.com/milesgranger/cramjam/actions/workflows/CI.yml/badge.svg)](https://github.com/milesgranger/cramjam/actions/workflows/CI.yml)
[![PyPI](https://img.shields.io/pypi/v/cramjam.svg)](https://pypi.org/project/cramjam)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/cramjam/badges/version.svg)](https://anaconda.org/conda-forge/cramjam)
[![Downloads](https://pepy.tech/badge/cramjam/month)](https://pepy.tech/project/cramjam)
[![NPM Version](https://img.shields.io/npm/v/cramjam)](https://www.npmjs.com/package/cramjam)
[API Documentation](https://milesgranger.github.io/cramjam/cramjam.html)
### Install (Python)
```commandline
pip install --upgrade cramjam # Requires no Python or system dependencies!
```
### Install (JavaScript / TypeScript)
```commandline
npm install cramjam
```
### CLI
A CLI interface is available as [`cramjam-cli`](https://github.com/cramjam/cramjam-cli)
### libcramjam
A Rust crate and C friendly library available at [libcramjam](https://github.com/cramjam/libcramjam)
---
Extremely thin and easy-to-install Python bindings to de/compression algorithms in Rust.
Allows for using algorithms such as Snappy, without any system or other python dependencies.
---
##### Benchmarks
Some basic benchmarks are available [in the benchmarks directory](./benchmarks/README.md)
---
Available algorithms:
- [X] Snappy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.snappy`
- [X] Brotli&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.brotli`
- [X] Bzip2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.bzip2`
- [X] Lz4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.lz4`
- [X] Gzip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.gzip`
- [X] Zlib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.zlib`
- [X] Deflate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.deflate`
- [X] ZSTD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.zstd`
- [X] XZ / LZMA&nbsp;&nbsp;`cramjam.xz`
Experimental (Requires build from source enabling each feature):
- [X] Blosc2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.experimental.blosc2`
- [X] ISA-L backend _(only on 64-bit targets)_
- [X] igzip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.experimental.igzip`
- [X] ideflate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.experimental.ideflate`
- [X] izlib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cramjam.experimental.izlib`
All available for use as:
```python
>>> import cramjam
>>> import numpy as np
>>> compressed = cramjam.snappy.compress(b"bytes here")
>>> decompressed = cramjam.snappy.decompress(compressed)
>>> decompressed
cramjam.Buffer(len=10) # an object which implements the buffer protocol
>>> bytes(decompressed)
b"bytes here"
>>> np.frombuffer(decompressed, dtype=np.uint8)
array([ 98, 121, 116, 101, 115, 32, 104, 101, 114, 101], dtype=uint8)
```
Where the API is `cramjam.<compression-variant>.compress/decompress` and accepts
`bytes`/`bytearray`/`numpy.array`/`cramjam.File`/`cramjam.Buffer` / `memoryview` objects.
**de/compress_into**
Additionally, all variants support `decompress_into` and `compress_into`.
Ex.
```python
>>> import numpy as np
>>> from cramjam import snappy, Buffer
>>>
>>> data = np.frombuffer(b'some bytes here', dtype=np.uint8)
>>> data
array([115, 111, 109, 101, 32, 98, 121, 116, 101, 115, 32, 104, 101,
114, 101], dtype=uint8)
>>>
>>> compressed = Buffer()
>>> snappy.compress_into(data, compressed)
33 # 33 bytes written to compressed buffer
>>>
>>> compressed.tell() # Where is the buffer position?
33 # goodie!
>>>
>>> compressed.seek(0) # Go back to the start of the buffer so we can prepare to decompress
>>> decompressed = b'0' * len(data) # let's write to `bytes` as output
>>> decompressed
b'000000000000000'
>>>
>>> snappy.decompress_into(compressed, decompressed)
15 # 15 bytes written to decompressed
>>> decompressed
b'some bytes here'
```
[TypeScript](./cramjam-js/README.md):
```typescript
import {Compress, Decompress} from 'cramjam';
const decoder = new TextDecoder();
const encoder = new TextEncoder();
const str = 'hello, world';
const encoded = encoder.encode(str);
const compressed = Compress.brotli(encoded);
const decompressed = Decompress.brotli(compressed);
const decoded = decoder.decode(decompressed);
```
@@ -0,0 +1,8 @@
cramjam-2.11.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
cramjam-2.11.0.dist-info/METADATA,sha256=oSNVpO84VB1eD49Aq_h106e1P0mcosr8QttntPRM3Wc,5561
cramjam-2.11.0.dist-info/RECORD,,
cramjam-2.11.0.dist-info/WHEEL,sha256=3AYdCBKhqgyMewMRMJE9Rm8WU27aRCol69bTswjLWkc,129
cramjam-2.11.0.dist-info/licenses/LICENSE,sha256=tPiCv8gNJ6NzJ4m9iDqMHTQuj_6n9iKnGz397YNCBf8,1070
cramjam/__init__.py,sha256=VjCBHPElEPhUkzw5PBYIbA1ZmQIbYLoCrhyBx8LIaHs,111
cramjam/__pycache__/__init__.cpython-311.pyc,,
cramjam/cramjam.cpython-311-x86_64-linux-gnu.so,sha256=mu9rdrte8kCWFdFmK1QC65SuxuDYGdGPQRUv6KC0GGQ,4579016
@@ -0,0 +1,4 @@
Wheel-Version: 1.0
Generator: maturin (1.9.1)
Root-Is-Purelib: false
Tag: cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Miles Granger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.