This release is a pre-release and may not be stable for production use.
UC2 for Python
Read UltraCompressor II archives using the native UC2 decoder. The package also includes the UC2 command-line program for listing, extraction, archive creation, and stream ingestion. Wheels contain the native code; no separate UC2 install or compiler is needed when a wheel is available.
This is an alpha release. It supports the implemented legacy Huffman methods, master dictionaries, directories, stored versions, and UC2 v3 rANS entries. Turbo/method 80 and multi-volume archives remain unsupported. The Python API is read-only; use the bundled CLI to create archives.
Install and read
python -m pip install --pre uc2
uc2 -l archive.uc2
python -m uc2 -t archive.uc2
Wheels support CPython 3.10-3.14 on Linux x86-64 (glibc), Windows x86-64, and Intel/Apple Silicon macOS.
from uc2 import UC2File
with UC2File("archive.uc2") as archive:
for info in archive.infolist():
print(info.filename, info.file_size, info.version)
contents = archive.read("notes.txt")
archive.verify()
archive.extractall("restored")
The constructor accepts a path or a seekable binary file, including BytesIO.
Caller-owned files stay open; their seek position changes. Keep the source
unchanged while the archive is open. Each thread should use its own UC2File.
infolist() and namelist() return the newest version of each path by default.
Use infolist(all_versions=True) to include older entries. A literal semicolon
in a filename remains part of the name:
with UC2File("archive.uc2") as archive:
newest = archive.read("notes.txt")
older = archive.read("notes.txt", version=1)
literal_name = archive.read("notes.txt;1")
UC2Info records the name, uncompressed and compressed sizes, DOS timestamp
(a naive datetime, or None if invalid), attributes, method, version, and
is_dir(). Metadata objects can be passed directly to read, extract, and
copy_to. They belong to the archive that produced them.
Limits and extraction
Defaults are 100,000 entries, 64 MiB of decoder allocations, 64 MiB per read,
1 GiB per streamed file, and 1 GiB total per extractall or verify call.
Constructor keywords are max_entries, max_decoder_memory, max_read_size,
max_extract_size, and max_total_size. They must be positive integers.
The decoder limit excludes Python metadata and caller-owned buffers. Archive
offsets and this reader are limited to 32 bits. These limits are not a CPU-time
sandbox for hostile input.
copy_to(member, binary_file) decodes without collecting the file in memory.
Its output may be partial if decoding or writing fails. extract and
extractall instead stage each file and install it after its UC2 checksum
passes. Existing files are preserved unless overwrite=True is supplied.
Earlier successfully extracted files remain if a later member fails.
Extraction rejects absolute paths, traversal, reserved Windows names, control characters, ambiguous case-folded names, and links below the destination. It uses file-descriptor-relative operations without following links on POSIX. Windows checks links and reparse points; use a destination that other processes cannot modify during extraction. The explicitly chosen destination itself may be a symlink. POSIX files use mode 0600 and directories use 0755, both masked by the process umask. Archived permissions and timestamps are exposed as metadata but not applied.
Errors include BadArchiveError, ResourceLimitError, UnsafePathError, and
ordinary Python I/O exceptions. Verification uses the archive's legacy
checksums, which are not cryptographic authentication. A missing entry or
version raises KeyError.
Build from source
Requires Python 3.10+, CMake, and a C99 compiler. The build backend obtains CMake when necessary.
python -m pip install .
python -m build
Source, releases, and the project roadmap are at github.com/evvaletov/uc2.
The distribution contains GPL-3.0-or-later and LGPL-3.0-only code. Independently written Python integration code also has a BSD-2-Clause option. This does not change the licenses of the bundled core or third-party code. License texts, credits, and the per-file audit are included in the distribution.
Metadata
Release files for uc2 3.0.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uc2-3.0.0a4.tar.gz | 255.5 kB | Without provenance | Details for uc2-3.0.0a4.tar.gz |
Built distributions (wheels)
Total release size: 3.9 MB
Release files / uc2-3.0.0a4.tar.gz
| Download URL | uc2-3.0.0a4.tar.gz |
|---|---|
| Size | 255.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6492aaaddc8cedbd2612cb7301491952314dc9c43c3fb608e0a46edcf3d43bb
|
|
BLAKE2b-256 checksum How to use checksums |
1377d61083127d97689aaa3c86946dea412714d5b3f336af248158b2a9127a5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp314-cp314-win_amd64.whl
| Download URL | uc2-3.0.0a4-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 300.0 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
11849b5351fffb93352e38d528fa9e2e4193d9f72e475ac469514106993c90e5
|
|
BLAKE2b-256 checksum How to use checksums |
00fc764a8acabcdeb207c6c4f9560f45ea6e34404027c1b7c2a215a362ec1025
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uc2-3.0.0a4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 148.1 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
fa46f00e303d5fc3119e9dc67ef3075f23a26b2545e4f7b33ae17b0e877ef738
|
|
BLAKE2b-256 checksum How to use checksums |
7521d07369137e7175de5b11c80726c2c06552617a916b20946378bae70ce532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | uc2-3.0.0a4-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 143.2 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9fc148bc888e47caa71e5cb0f4705b82cb10790f14d19fda0e312e7120444213
|
|
BLAKE2b-256 checksum How to use checksums |
b9c9f2f243e946281257b1c17faff210510a44ecfaf28a7f0ae32c3799d9fc4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp314-cp314-macosx_10_15_x86_64.whl
| Download URL | uc2-3.0.0a4-cp314-cp314-macosx_10_15_x86_64.whl |
|---|---|
| Size | 146.9 kB |
| Tags | CPython 3.14 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
138771a55577c7e42d60055b4911494951dda72aa7469be971aaddd35ddc9af8
|
|
BLAKE2b-256 checksum How to use checksums |
f34869f306e7cb824683373527eaf8aff46844b027b1ff5aa26390f4a71c7b9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp313-cp313-win_amd64.whl
| Download URL | uc2-3.0.0a4-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 293.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
84cbf9f51be8ab3cf02d03f5d1373bbdff56e252622ff10154583dca9385ec44
|
|
BLAKE2b-256 checksum How to use checksums |
0ab42f82620d6570fa15d445681c75029ee14c8ce051fc0a254e050ade7bd678
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uc2-3.0.0a4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 148.1 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ac9a7e401e7a55c36860af5012e3a0296d6b063629be9e4809f7a4ca86ccc3b3
|
|
BLAKE2b-256 checksum How to use checksums |
f21714ef44973f64f1a3fd3223ee36903bbda53d39c3d34189a0588972be0641
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | uc2-3.0.0a4-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 143.3 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
951cd7999692487c985873692abab65ae1adf13c6305bbdc358126157029b1cd
|
|
BLAKE2b-256 checksum How to use checksums |
e479e3bdc84d51b23a2a09f3a3c7dbf5f0f098fa3db6a8676bba4cc4c8cf203a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | uc2-3.0.0a4-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 146.6 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
e0e125cb573412417ab4819d60343e6159fb672dab18cf60943c7595689ffcff
|
|
BLAKE2b-256 checksum How to use checksums |
6bdc77cb24e5eb71da425063fee4e68f778691731a473e8ee45602e04b743afb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp312-cp312-win_amd64.whl
| Download URL | uc2-3.0.0a4-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 293.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d6da81b768f6f26670d7697e863946c10db505f39e6e2a6f112ec0f22d52e648
|
|
BLAKE2b-256 checksum How to use checksums |
d4f62dcccd3f41758c0d598313585b36a5577ec16083b6244c0340c37c69a073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uc2-3.0.0a4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 148.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5db4e7018c6b1956daa392e3e8b877e9e341c20952675d904b107607bdd2a104
|
|
BLAKE2b-256 checksum How to use checksums |
0bb32ee2724da1a8046a75fbefe869003cc88144c740e699de0166c2f0c3eee5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | uc2-3.0.0a4-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 143.3 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8e6a00d63c94852e1013eab13b56615385cb25badb73f8a3bd242053f4590687
|
|
BLAKE2b-256 checksum How to use checksums |
d486be06e961076961886243ddee7fd2da4f52ae893749634964d390748d15d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | uc2-3.0.0a4-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 146.6 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
3f6e386753fb120ef489b1e7e1a31b0bac1fa7d9cafc3932d847387e34e1900f
|
|
BLAKE2b-256 checksum How to use checksums |
7c52c71938253301bd793b549bd3f5f89617f196c795a9627dce422fb4226213
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp311-cp311-win_amd64.whl
| Download URL | uc2-3.0.0a4-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 293.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e84644fdbcadc7e9bf46e4ddd8715eb7381a6204cf9292283adf2ccae8b61160
|
|
BLAKE2b-256 checksum How to use checksums |
52c61ef71d52de032e3b23c36ad134adf8179028abf705781dfcd3b8bea75e33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uc2-3.0.0a4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 148.1 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e175dac7c426198eb51b1419b9b7e042a267179a50b5462ddb0194509aaaa4d1
|
|
BLAKE2b-256 checksum How to use checksums |
a065c0df00e362cfc2e73d7c3ffa0338cccce226127fc70c387c0fc8af144453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | uc2-3.0.0a4-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 143.2 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
17e7a324be228c0b804d6888b4f359153b5cac43fe0d88f79ec598e37cade8dc
|
|
BLAKE2b-256 checksum How to use checksums |
0c5d2b903e98bea925946df2e303fcc61ee1a45520abe8e8d0306d58e87f373e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | uc2-3.0.0a4-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 145.8 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
f271c1743202ccc8aee4d24d85fb9f76f29d279aefe60e23af93ecdfdf69feda
|
|
BLAKE2b-256 checksum How to use checksums |
06640d64a0702fab0af6943166eb90b0f6d45260fa1a3ce562af77278516cc9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp310-cp310-win_amd64.whl
| Download URL | uc2-3.0.0a4-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 293.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
47d585a9db09b3475685166792a712507bdebcc3d256be14751ab0fbbea7abe1
|
|
BLAKE2b-256 checksum How to use checksums |
bb66b601567b43f8be9fa619d5aa085bbe14211cab474d027f39544a83c1a618
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uc2-3.0.0a4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 148.2 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8c8b41e5139f92a58b120b81c960afc081046537fea1a9718c8d49f6dd749f2f
|
|
BLAKE2b-256 checksum How to use checksums |
19e2c4d6f84bf8419ed965d67015d76f0dc7dbd4eac8d736b779538e70fa650b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | uc2-3.0.0a4-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 143.4 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1bc81794f65ea133aceb08b4e318ef4ef5c24168db7a693c0aa258ed39743955
|
|
BLAKE2b-256 checksum How to use checksums |
755907be8c89fb88f8c64981d7707055be18a9ba207b369ed252bde3403f3b9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / uc2-3.0.0a4-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | uc2-3.0.0a4-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 146.0 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
895af9d9c781255a71ad69783ab7bf5bd91fae46934349c6f008ca2990c45aca
|
|
BLAKE2b-256 checksum How to use checksums |
010e4e113518fe9c8cd5158660789ed6c371b96680979edd86add491b52a5674
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for uc2 3.0.0a4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.