Arabic-first single-byte encoding with ASCII compatibility and native SIFR codec bindings
Project description
SIFR Python Package
SIFR is a compact codec for Arabic text that maps Unicode codepoints to a byte representation. This package provides thin Python bindings for the native SIFR C codec.
Why this package?
- Compact storage: SIFR encodes Arabic text to a smaller byte stream than UTF-8 in many cases.
- Fast round-trip: Encode to bytes, decode back to codepoints quickly.
- Simple API: One
encode()and onedecode().
Note: SIFR is an encoding, not encryption. The output is binary data, not hidden text.
Installation
pip install pysifr
Basic Usage
from sifr import encode, decode
text = "السلام عليكم\n[EXT] ؐ ۖ ࣉ ࢠ"
cps = [ord(ch) for ch in text]
sifr_bytes = encode(cps)
back = "".join(chr(cp) for cp in decode(sifr_bytes))
assert back == text
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysifr-0.0.3-py3-none-win_amd64.whl.
File metadata
- Download URL: pysifr-0.0.3-py3-none-win_amd64.whl
- Upload date:
- Size: 82.4 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fbbd903ed7dd3a42f6652582a3f9c58262a26510db4079bf12ce63cb5922c2e
|
|
| MD5 |
37c388e3f916806eafae218ecc5553e8
|
|
| BLAKE2b-256 |
4fdd2865e43423254f36b5373cadadf99d5dd137297f26e6bfdce8df4123dad6
|
File details
Details for the file pysifr-0.0.3-py3-none-manylinux_2_31_aarch64.whl.
File metadata
- Download URL: pysifr-0.0.3-py3-none-manylinux_2_31_aarch64.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3, manylinux: glibc 2.31+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
018849c174b9358b4bc46a672b2e608b30277f8861477c6cb034ceecc78c07aa
|
|
| MD5 |
f72380096dbc8c5c4795008a3080cbd7
|
|
| BLAKE2b-256 |
346a46839712dd399f706014dd34d68dbd07fefcc3d9e6faa789452ada0d1dab
|
File details
Details for the file pysifr-0.0.3-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: pysifr-0.0.3-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b55f897e2b15dedca82a58430b54fd0545eb8637e326666e5ac33215674159f
|
|
| MD5 |
f1c3743512e05d8baf11e411894d795a
|
|
| BLAKE2b-256 |
76ba348524b240fa7fad949359a66551d1004201396de38ba95d2f01aae48f41
|