PyYAML-ft
YAML parser and emitter for Python with support for free-threading
What it is and what it does
PyYAML-ft is a fork of PyYAML designed specifically for Python 3.13's free-threaded build. It provides YAML parsing and serialization with thread-local registries for custom constructors, representers, and resolvers—meaning these must be registered per-thread rather than globally. The package uses Cython 3.1 (still experimental) and optionally compiles against LibYAML for faster C-based parsing and emission.
The main trade-off is that custom YAML handlers registered in one thread are not automatically available in others; you must re-register them in each thread's worker function. This is a deliberate design choice to avoid thread-safety issues that the GIL previously masked. For applications using only built-in YAML types, the API is identical to upstream PyYAML.
Use it for:
- Parse YAML configuration files in multi-threaded Python 3.13 applications without GIL contention.
- Serialize Python objects to YAML in free-threaded environments where concurrent dumping is needed.
- Test upstream PyYAML behavior under free-threading before the official port is merged.
- Build thread-pool-based services that load YAML documents concurrently on Python 3.13t.
- Use safe_load() for untrusted YAML input in multi-threaded contexts without thread-safety concerns.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyYAML-ft is a YAML parser and emitter for Python 3.13 with support for free-threaded execution, allowing thread-safe YAML processing without the Global Interpreter Lock.
Yes, if you are running Python 3.13 or 3.13t and need YAML processing in a multi-threaded application. The aging maintenance status (430 days since last release) is acceptable given the package's stated purpose as a temporary fork pending upstream support; however, verify that Cython 3.1's free-threading support is stable enough for your workload. For Python < 3.13, use upstream PyYAML instead.
Install
pyyaml-ft on PyPI
pip
pip install pyyaml-ftuv
uv add pyyaml-ftpoetry
poetry add pyyaml-ftInstalling PyYAML-ft
Before you install
Medium install friction due to compiled C extensions. The package is aging—last release was 430 days ago—but the repository remains active with a recent commit on 2025-06-10. No runtime dependencies simplifies deployment once installed.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions. No licensing friction for most projects.
Quickstart
pip install PyYAML-ft
import PyYAML-ft
data = PyYAML-ft.safe_load('key: value')
print(data)
Requires Python 3.13 or 3.13t (free-threaded build); will not install on earlier Python versions.
Verify before relying
- Whether LibYAML bindings are reliably available on all supported platforms or fall back silently.
- Performance characteristics compared to upstream PyYAML when running on free-threaded Python 3.13.
- Stability of Cython 3.1 support for free-threading in production workloads.
- Thread-local registry behavior and whether re-registration per thread is required for custom constructors.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.13) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 430 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,219,784/month — #1,467 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyyaml_ft-8.0.0-cp313-cp313-macosx_10_13_x86_64.whl; pyyaml_ft-8.0.0-cp313-cp313-macosx_11_0_arm64.whl; pyyaml_ft-8.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyyaml_ft-8.0.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl; pyyaml_ft-8.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyyaml_ft-8.0.0-cp313-cp313-musllinux_1_2_aarch64.whl; pyyaml_ft-8.0.0-cp313-cp313-musllinux_1_2_x86_64.whl; pyyaml_ft-8.0.0-cp313-cp313t-macosx_10_13_x86_64.whl; pyyaml_ft-8.0.0-cp313-cp313t-macosx_11_0_arm64.whl; pyyaml_ft-8.0.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyyaml_ft-8.0.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl; pyyaml_ft-8.0.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyyaml_ft-8.0.0-cp313-cp313t-musllinux_1_2_aarch64.whl; pyyaml_ft-8.0.0-cp313-cp313t-musllinux_1_2_x86_64.whl; pyyaml_ft-8.0.0-cp313-cp313t-win_amd64.whl; pyyaml_ft-8.0.0-cp313-cp313-win_amd64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
yamlcoreAdds YAML 1.2 Core Schema support to PyYAML,…
permissive · top 15,000 on PyPI
ruamel.yaml.clibProvides a C-based YAML 1.2 reader, parser, and…
permissive · top 1,000 on PyPI
yamlloaderProvides specialized loaders and dumpers for…
permissive · top 15,000 on PyPI
pyyaml-includeExtends PyYAML to include other YAML files into…
copyleft · top 5,000 on PyPI
pyamlProduces human-readable, diff-friendly YAML…
permissive · top 5,000 on PyPI
yaml-rsA high-performance YAML v1.2 parser for Python,…
permissive · top 15,000 on PyPI
saneyamlA lightweight PyYAML wrapper that reads and…
permissive · top 15,000 on PyPI
shyamlCommand-line tool for querying and extracting…
permissive · top 5,000 on PyPI
rapidyamlParses and emits YAML documents via a fast C++…
permissive · top 15,000 on PyPI