Skip to main content

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saad_z-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

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

Hashes for saad_z-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c37cae451dc186cdae74f629a22dff8269577d29844a474882d208a3bb0b7c4
MD5 c34464375810be88fb702721424f4d21
BLAKE2b-256 a078216fd6993a7f97047e73c8be52f0332738c091f85d0c7383cae66348a1b6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page