saad-z
حزمة Python باسم saad_z تعيد تصدير واجهة zstandard تحت اسم جديد:
from saad_z import ZstdDecompressor, ZstdCompressionDict, DICT_TYPE_AUTO
الحزمة نفسها غلاف خفيف، بينما تنفيذ الضغط وفك الضغط يأتي من مشروع zstandard الأصلي. لذلك تحافظ على الأداء والتوافق بدل إعادة تنفيذ محرك Zstandard.
التثبيت
python -m pip install saad-z
يتطلب التثبيت محرك zstandard الثنائي المتوافق مع إصدار Python ونظام التشغيل. على Pydroid 3 أو Android قد لا يتوفر wheel جاهز، وعندها قد يفشل التثبيت ما لم تتوفر أداة بناء مناسبة للامتداد الأصلي.
ضغط وفك ضغط بسيط
from saad_z import ZstdCompressor, ZstdDecompressor
source = b"SAAD compression example " * 100
compressed = ZstdCompressor(level=3).compress(source)
restored = ZstdDecompressor().decompress(compressed)
assert restored == source
print(len(source), len(compressed))
استخدام الأسماء المطلوبة
from saad_z import ZstdDecompressor, ZstdCompressionDict, DICT_TYPE_AUTO
raw_dictionary = b"SAAD dictionary data " * 20
dictionary = ZstdCompressionDict(raw_dictionary, dict_type=DICT_TYPE_AUTO)
print(dictionary.dict_id())
print(len(dictionary.as_bytes()))
ملاحظات التوافق
تتوفر بقية الأسماء العامة في zstandard تلقائيًا عبر saad_z، بما فيها ZstdCompressor وZstdCompressionParameters وtrain_dictionary عند توفرها في الإصدار المثبت.
هذه الحزمة لا تنسخ كود zstandard الأصلي؛ بل تعتمد عليه كاعتماد خارجي. راجع ترخيص zstandard upstream من الرابط التالي:
https://github.com/indygreg/python-zstandard
الترخيص
كود واجهة saad_z مرخص MIT. أما محرك zstandard فهو مشروع مستقل بترخيص BSD-3-Clause، وتظل شروطه سارية على الاعتماد المثبت.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
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 saad_z-0.1.0-py3-none-any.whl.
File metadata
- Download URL: saad_z-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c37cae451dc186cdae74f629a22dff8269577d29844a474882d208a3bb0b7c4
|
|
| MD5 |
c34464375810be88fb702721424f4d21
|
|
| BLAKE2b-256 |
a078216fd6993a7f97047e73c8be52f0332738c091f85d0c7383cae66348a1b6
|