yamlcore
YAML 1.2 Support for PyYAML
What it is and what it does
yamlcore extends PyYAML to parse YAML 1.2 files using the Core Schema specification, which differs from PyYAML's default YAML 1.1 behavior in how it interprets types and handles edge cases. For example, strings like 'yes' and 'no' remain strings in YAML 1.2 (not booleans), and numeric literals like '0x42' and '0o10' are correctly parsed as hex and octal. The package enforces the YAML spec's requirement that duplicate keys are forbidden, catching accidental key collisions that PyYAML would silently allow.
It inherits from PyYAML rather than forking it, providing CoreLoader and CoreDumper classes that work alongside the standard PyYAML module. The package also offers C-accelerated variants (CCoreLoader, CCoreDumper) for users with libyaml installed. It is designed as a stopgap until PyYAML itself adds YAML 1.2 support, which has been pending in a pull request.
Use it for:
- Loading YAML 1.2 configuration files where strict type interpretation matters (e.g., distinguishing 'yes' as a string, not a boolean).
- Catching duplicate keys in YAML documents during parsing to prevent silent data loss.
- Migrating from YAML 1.1 to YAML 1.2 while keeping the rest of your PyYAML workflow intact.
- Parsing hexadecimal and octal literals correctly as per YAML 1.2 spec (0x42, 0o10).
- Dumping YAML with Core Schema compliance using CoreDumper.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds YAML 1.2 Core Schema support to PyYAML, enabling strict parsing of YAML 1.2 files with correct type interpretation and duplicate-key rejection.
Yes, if you need YAML 1.2 Core Schema compliance and PyYAML hasn't yet merged native support. The package is low-friction to install, carries no security issues, and solves a real spec-compliance gap. However, check whether the pending PyYAML PR has been merged in your target PyYAML version first—if it has, use PyYAML's native support instead. The dormant maintenance status is acceptable for a thin compatibility layer, but monitor for PyYAML API changes.
Install
yamlcore on PyPI
pip
pip install yamlcoreuv
uv add yamlcorepoetry
poetry add yamlcoreInstalling yamlcore
Before you install
Low friction: pure Python wheel with a single runtime dependency on PyYAML. Dormant maintenance (674 days since last release, last commit 2024-10-11) but marked Production/Stable and carrying no known vulnerabilities.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects.
Quickstart
from yamlcore import CoreLoader, CoreDumper
y = """---
core:
- true
- 0o10
- 0x42
- ~
"""
d = CoreLoader().get_single_data(y)
out = CoreDumper().represent(d)
Requires PyYAML to be installed; Python 3.6 or later.
Verify before relying
- Whether the pending PyYAML PR #555 has since been merged, potentially making this package obsolete.
- Performance characteristics compared to PyYAML's default loader on large YAML files.
- Compatibility with PyYAML versions beyond those tested at release time.
- Exact usage patterns for CoreLoader and CoreDumper integration with PyYAML.
Package facts
| License | MIT License Copyright (c) 2024 Tina Müller (tinita) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — PyYAML |
| Maintenance | dormant — 674 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 258,593/month — #8,428 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: yamlcore-0.0.4-py3-none-any.whl
Keywords: yaml
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
saneyamlA lightweight PyYAML wrapper that reads and…
permissive · top 15,000 on PyPI
pyyaml-includeExtends PyYAML to include other YAML files into…
copyleft · top 5,000 on PyPI
PyYAML-ftPyYAML-ft is a YAML parser and emitter for…
permissive · top 5,000 on PyPI
aspy.yamlProvides order-preserving YAML loading and…
permissive · top 15,000 on PyPI
yamlloaderProvides specialized loaders and dumpers for…
permissive · top 15,000 on PyPI
types-PyYAMLProvides type stubs for PyYAML to enable static…
permissive · top 1,000 on PyPI
keynote-parserUnpack, edit, and re-pack Apple Keynote .key…
permissive · top 15,000 on PyPI
pyyaml-env-tagAdds a custom YAML tag that lets you reference…
permissive · top 5,000 on PyPI
shyamlCommand-line tool for querying and extracting…
permissive · top 5,000 on PyPI