You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.14 introduces the compression.zstd module, adding Zstandard support to the standard library (PEP 784). The CPython implementation was adapted from the pyzstd codebase. As the maintainer of pyzstd, I was contacted by @emmatyping and contributed to this effort.
I believe the future of Zstandard in Python lies in the stdlib, with additional libraries offering extra functionality in pure Python (without the need for a C module). A shared codebase maintained by CPython core developers will mutualize the work (updates, security, performance, etc.), and benefit the entire community.
As a result, below is my personal plan of action:
Help with PEP 784 and the integration of pyzstd into stdlib ➡️ was done in the last few months.
Backport the code from stdlib to support for Python versions before 3.14 ➡️ backports.zstd is available.
Promote adoption of the stdlib and help with migration.
Use stdlib in pyzstd.
For pyzstd specifically, I am working on the following points:
Update the readme and documentation to recommend the standard library for new users and provide a migration guide for existing users.
Deprecate parts of the pyzstd public API that cannot be reimplemented using the standard library.
Refactor the pyzstd codebase to use stdlib instead of C/CFFI bindings, making pyzstd a pure Python module.
This ticket will be used to gather feedback and track progress on the above plan.
Refactor the pyzstd codebase to use stdlib instead of C/CFFI bindings, making pyzstd a pure Python module.
The refactor is happening in #56! There may still be some rough edges, but it is usable at this point.
This took longer than anticipated, due to the SeekableZstdFile class being intertwine with ZstdFile. I managed to get away with this by… refactoring it out in #55.
Activity
Rogdham commentedon Sep 24, 2025
This is now live on the git
masterbranch and thelatestversion of the documentation.It will become automatically promoted to the
stableversion of the documentation on the next release ofpyzstd.Rogdham commentedon Oct 4, 2025
This has been done in #47. Very few deprecations!
Rogdham commentedon Nov 30, 2025
The refactor is happening in #56! There may still be some rough edges, but it is usable at this point.
This took longer than anticipated, due to the
SeekableZstdFileclass being intertwine withZstdFile. I managed to get away with this by… refactoring it out in #55.Rogdham commentedon Dec 7, 2025
Version 0.19.0 of
pyzstdhas been released! 🚀pyzstdis now a pure-python module, relying oncompression.zstd(orbackports.zstdfor Python before 3.14), without any public API changes.This completes the plan created last September.
ThomasWaldmann commentedon Jan 21, 2026
@Rogdham @emmatyping Thanks much to you both for moving this into py314 stdlib (and providing that backport for older Pythons).
Now we can remove our Cython-based binding to libzstd from Borg Backup. \o/