--- id: yamlcore version: "0.0.4" 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) license_treatment: permissive maintenance: dormant --- # yamlcore — YAML 1.2 Support for PyYAML License: permissive · Maintenance: dormant · Downloads: 258.6K/mo ## 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 above — 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 pip install yamlcore uv add yamlcore 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_current - Install friction: low - Maintenance: dormant - Downloads: 258.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags yaml 1.2 parser, pyyaml 1.2 schema, strict yaml loading, yaml core schema, yaml type conversion, yaml duplicate key detection, pyyaml compatibility layer, yaml-parsing, schema-compliance [View on SkillFed](https://skillfed.io/packages/yamlcore) · [View on PyPI](https://pypi.org/project/yamlcore/)