Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyyaml-core - YAML 1.2 Core Schema Support for PyYAML

This module can be used on top of PyYAML to load YAML 1.2 files. It depends on PyYAML and inherits from it, it's not a fork.

Currently it supports enabling all YAML 1.2 Core Schema tags on top of the PyYAML BaseLoader. It does not (yet) support other tags like the << merge key. You can add custom constructors, though.

For more information see the comparison of 1.1 and 1.2 schemas.

Examples

import yaml
from yamlcore import CoreLoader
from yamlcore import CoreDumper

y = """
---
1.1: # strings
- yes
- no # norway problem anymore
- 1__0
- 10:20
- +0b100
- 0x4_2

core:
- true
- 0o10
- 0x42
- ~
- .inf
"""

d = yaml.load(y, Loader=CoreLoader)
out = yaml.dump(d, Dumper=CoreDumper)

You can also use CCoreLoader and CCoreDumper for using the libyaml based parser and emitter.

Why?

At the time of this writing, there is a pending pull request that adds YAML 1.2 Core Schema Support for PyYAML.

It's blocked because there is a plan to redesign the API, and no new things shall be added using the old API at this point.

So as long as PyYAML doesn't merge this, you can use this module as an alternative.

Differences

There are other differences in behaviour to PyYAML.

Duplicate keys are not allowed

The YAML spec forbids duplicate keys. PyYAML allows them, which leads to accidentally added duplicate keys in YAML files, eventually.

I can't see a good use case that people would want to allow duplicate keys in a typical YAML loading process. For the use cases I see you would want your own constructor anyway.

If this is breaking anyone's use case, please let me know.

Metadata

Release files for yamlcore 0.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yamlcore 0.1.0b2
File Size Uploaded Provenance Actions
yamlcore-0.1.0b2.tar.gz 10.7 kB With provenance Details for yamlcore-0.1.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yamlcore 0.1.0b2
File Interpreter ABI Platform Actions
yamlcore-0.1.0b2-py3-none-any.whl Python 3 none any Details for yamlcore-0.1.0b2-py3-none-any.whl

Total release size: 16.7 kB

Release files / yamlcore-0.1.0b2.tar.gz

Download URL yamlcore-0.1.0b2.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5dcf8a67cbb6de740bb671de3295af2d96fec5df7c3652a91dcf4ed29a5d0f4a
BLAKE2b-256 checksum
How to use checksums
419d738fe480c154bd3043f5ced99e3d903580072c34f22b57bf49677843b0f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / yamlcore-0.1.0b2-py3-none-any.whl

Download URL yamlcore-0.1.0b2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b7491d6fdfcc9415ca6192c259efc4552e71c10c7cde277d76b660c523ffda5
BLAKE2b-256 checksum
How to use checksums
022114ae4b8ae29359dafd9efb07b2159763e840ab0b56a4506923c4b99eac97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for yamlcore 0.1.0b2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yamlcore-0.1.0b2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page