skillfed

PyYAML-ft

YAML parser and emitter for Python with support for free-threading

pyyaml-ft v8.0.0 10.2M downloads/30d#1,467 on PyPI1
Permissive license MIT AGING released

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-ft

uv

uv add pyyaml-ft

poetry

poetry add pyyaml-ft

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3.13Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Markup

Tags

yaml parser python 3.13free-threaded yaml processingthread-safe yaml libraryyaml emitter pythonpyyaml alternative 3.13libyaml bindings pythonyaml serialization deserialization
free-threadingpython-3.13

More Python Modules packages