skillfed

yamlcore

YAML 1.2 Support for PyYAML

yamlcore v0.0.4 258.6K downloads/30d#8,428 on PyPI18
Permissive 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) DORMANT released

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 yamlcore

uv

uv add yamlcore

poetry

poetry add yamlcore

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

yaml 1.2 parserpyyaml 1.2 schemastrict yaml loadingyaml core schemayaml type conversionyaml duplicate key detectionpyyaml compatibility layer
yaml-parsingschema-compliance

More Markup packages