uniscript (pure Python)
The uniscript converter in pure Python without dependencies, a port of the Rust reference (src/lib.rs). It reads
data/entities.idx (bundled as uniscript/entities.idx) in place through mmap. Same API as the FFI package in
python/ffi (uniscript-rs), so either one is a drop-in replacement for the other.
pip install uniscript-py # imported as `import uniscript`
import uniscript
uniscript.to_unicode("<:alpha> <:fracture A>") # 'α 𝔄'; lenient: warnings go to stderr
uniscript.to_uniscript("α 𝔄") # '<:alpha> <:fracture A>'
uniscript.convert("<:greek c>") # ('c', [Warning(message='no greek form of c', at=0)])
uniscript.convert("<:nosuch>", uniscript.WarningMode.WARN) # raises UnknownEntity; ERROR raises Unsupported on warnings
converter = uniscript.Uniscript()
styled, warnings = converter.meta_runs(uniscript.to_unicode("<:color red A>"))
converter.html(styled) # '<span style="color: red">A</span>'
Offsets (Warning.at, Header.length, MetaRun.start/end/at) are UTF-8 byte offsets, as in Rust and Swift.
python3 -m uniscript is the command line of the Rust crate (-r, --strict, --lenient, --html).
Tests: PYTHONPATH=. python3 -m pytest tests (in python/native). tests/test_reference.py compares with the Rust
binary at /opt/cargo/release/uniscript (CARGO_TARGET_DIR=/opt/cargo cargo build --release), skipped without it.
Metadata
Release files for uniscript-py 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uniscript_py-1.0.0.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uniscript_py-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.5 MB
Release files / uniscript_py-1.0.0.tar.gz
| Download URL | uniscript_py-1.0.0.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
385dfcda37b2f5702aa35a44afa4063f03dc31cac51b7e9ed904907ca525b36f
|
|
BLAKE2b-256 checksum How to use checksums |
6b8b59ae96c775ac0ac83d1eca74e0ad9f758b0171bb55bcbdcacaf85e952fea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / uniscript_py-1.0.0-py3-none-any.whl
| Download URL | uniscript_py-1.0.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7487fb2f866e2f714ba67355dc12a6d5bcff63333a30bd64e4c5c6506ff2abf7
|
|
BLAKE2b-256 checksum How to use checksums |
28191e268524b8e0780d989b52206932ab1f3b64997020210cb645ba745e6f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|