Metadata-Version: 2.5
Name: unstd
Version: 4.0.2
Summary: stdlib-faithful accelerated replacements behind optional extras
Project-URL: Homepage, https://github.com/The-Billy-Company/unstd
Project-URL: Repository, https://github.com/The-Billy-Company/unstd
Project-URL: Changelog, https://github.com/The-Billy-Company/unstd/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/The-Billy-Company/unstd/issues
Author: The Billy Company
License-Expression: Apache-2.0 AND MIT AND Zlib AND BSD-3-Clause
License-File: LICENSE
License-File: NOTICE
License-File: native/compress/vendor/isa-l/LICENSE
License-File: native/compress/vendor/libdeflate/COPYING
License-File: native/compress/vendor/zlib/LICENSE
Keywords: blake3,extras,json,msgspec,orjson,stdlib,uuid
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Provides-Extra: archives
Requires-Dist: libarchive-c>=5.3; (sys_platform != 'win32') and extra == 'archives'
Provides-Extra: audio
Requires-Dist: numpy>=2.5; extra == 'audio'
Requires-Dist: soundfile>=0.14; extra == 'audio'
Provides-Extra: clone
Provides-Extra: compress
Requires-Dist: zlib-ng>=1.0; extra == 'compress'
Provides-Extra: containers
Requires-Dist: immutables>=0.21; extra == 'containers'
Requires-Dist: sortedcontainers>=2.4; extra == 'containers'
Provides-Extra: crypto
Requires-Dist: blake3>=1.0.10; extra == 'crypto'
Provides-Extra: ids
Requires-Dist: uuid-utils>=0.17; extra == 'ids'
Provides-Extra: model
Requires-Dist: pydantic-settings>=2.15; extra == 'model'
Requires-Dist: pydantic>=2.13; extra == 'model'
Provides-Extra: pack
Requires-Dist: numpy>=2.5; extra == 'pack'
Provides-Extra: proto
Requires-Dist: protobuf>=7.36; extra == 'proto'
Provides-Extra: rand
Requires-Dist: numpy>=2.5; extra == 'rand'
Provides-Extra: rex
Requires-Dist: irregex>=2.6.0; extra == 'rex'
Provides-Extra: serde
Requires-Dist: msgspec>=0.22; extra == 'serde'
Requires-Dist: orjson>=3.12; extra == 'serde'
Requires-Dist: pybase64>=1.5; extra == 'serde'
Provides-Extra: text
Requires-Dist: rapidfuzz>=3.12.0; (python_version < '3.14') and extra == 'text'
Requires-Dist: rapidfuzz>=3.14; (python_version >= '3.14') and extra == 'text'
Provides-Extra: time
Requires-Dist: whenever>=0.10; extra == 'time'
Provides-Extra: toml
Requires-Dist: tomlkit>=0.15; extra == 'toml'
Provides-Extra: yaml
Requires-Dist: pyyaml>=6.0.3; extra == 'yaml'
Requires-Dist: ruamel-yaml>=0.19; extra == 'yaml'
Provides-Extra: zstd
Requires-Dist: zstandard>=0.25; extra == 'zstd'
Description-Content-Type: text/markdown

---
doc_radar:
  sentinels:
    - file: pyproject.toml
      contains: ['version = "4.0.2"', 'requires-python = ">=3.12"']
    - file: CHANGELOG.md
      contains: ['## [4.0.2] - 2026-10-25']
---

# unstd

**An accelerated Python standard library for hot-path operations.**

unstd accelerates serialization, compression, deep copying, hashing, and other
hot paths with bundled native code, optional backends, and familiar Python APIs.

Requires **Python 3.12+**. The base install has **no third-party runtime
dependencies**.

## Install

```sh
python -m pip install unstd

# Add accelerated serialization and compression backends:
python -m pip install 'unstd[serde,compress]'
```

Install only the extras you need. Compatible CPython wheels include bundled C
extensions; source builds use them when a compiler is available and retain
portable fallbacks otherwise.

Linux CPython wheels also accelerate [`fs.atomic_write`](src/unstd/fs/README.md)
without an extra dependency, while retaining the complete Python fallback.

## Quick start

```python
from unstd import clone
from unstd.compress import gzipx
from unstd.serde import jsonx

payload = {"events": [{"name": "saved", "count": 1}]}

text = jsonx.dumps(payload)  # str; stdlib JSON defaults and formatting
raw = jsonx.dumpb(payload)  # bytes; compact UTF-8 JSON
copy = clone.deep(payload)  # independent mutable copy
packed = gzipx.compress(raw, mtime=0)
restored = jsonx.loads(gzipx.decompress(packed))
```

To migrate existing JSON calls, use `from unstd.serde import jsonx as json`.

## Choose a module

| Operation | Module | Optional extra |
| --- | --- | --- |
| JSON, Base64, NDJSON, typed codecs | [`serde`](src/unstd/serde/README.md) | `serde` |
| Deep copying and dataclass conversion | [`clone`](src/unstd/clone/README.md) | None |
| Gzip/zlib streams, Zstandard, archive bindings | [`compress`](src/unstd/compress/README.md) | `compress`, `zstd`, `archives` |
| UUIDs and BLAKE3 hashing | [`ids`](src/unstd/ids/README.md), [`crypto`](src/unstd/crypto/README.md) | `ids`, `crypto` |
| Clocks, zoned time, Protobuf timestamp bridge | [`time`](src/unstd/time/README.md) | `time`, `proto` |
| Validated models and settings | [`model`](src/unstd/model/README.md) | `model` |
| Sorted collections and persistent mappings | [`containers`](src/unstd/containers/README.md) | `containers` |
| Regex and fuzzy matching | [`rex`](src/unstd/rex/README.md), [`text`](src/unstd/text/README.md) | `rex`, `text` |
| Numeric frames, bulk packing and random draws | [`pack`](src/unstd/pack/README.md), [`rand`](src/unstd/rand/README.md) | `pack`, `rand` |
| TOML writing and YAML parsing/editing | [`toml`](src/unstd/toml/README.md), [`yaml`](src/unstd/yaml/README.md) | `toml`, `yaml` |
| Audio decoding, encoding, and streaming | [`audio`](src/unstd/audio/README.md) | `audio` |
| Atomic files, subprocesses, iteration | [`fs`](src/unstd/fs/README.md), [`proc`](src/unstd/proc/README.md), [`iters`](src/unstd/iters/README.md) | None |

The [module index](src/unstd/README.md) and individual guides describe backend
requirements and fallback behavior.

## Compatibility and performance

Compatibility is defined per module. `jsonx` preserves stdlib JSON behavior,
including formatting, hooks, and errors, falling back when needed. Additional
helpers such as `clone.deep` and `proc.run` have their own documented contracts.
Gzip streams remain interoperable, but compressed bytes can differ by backend.

Without optional backends, modules use stdlib fallbacks where available;
capabilities without a faithful fallback raise `ImportError`. Some helpers,
including fuzzy matching and bulk randomness, can produce different results
across backends. Check the module guide before migrating.

Speed depends on your data, interpreter, platform, and installed backends.
Profile your application and benchmark its actual hot paths. The
[benchmark guide](bench/README.md) provides reproducible comparisons and reports
both gains and regressions.

## Development

See the [test guide](tests/README.md), [architecture](docs/architecture.md),
[API inventory](docs/api.md), and [security policy](SECURITY.md).

[October 25 updates](docs/updates-2026-10-25.md) cover version 4.0.2; the
[changelog](CHANGELOG.md) records its compatibility changes.

First-party code is Apache-2.0; bundled licenses are listed in [NOTICE](NOTICE).
