Skip to main content

YAML utilities for reuse along projects.

Project description

A lightweight YAML utility library with validation support using Cerberus, designed for simplicity and composability in structured Python projects.

Build Status Deploy Status Codecov Black code style License PyPi GitHub Pages

Overview

darca-yaml provides utilities for:

  • 📖 Loading and saving YAML files

  • ✅ Validating YAML content with Cerberus

  • 🔗 Integrated exception handling (darca-exception)

  • 📄 File handling via darca-file-utils

  • 🧪 100% test coverage with Pytest and CI integration

Installation

pip install darca-yaml

Usage

from darca_yaml.yaml_utils import YamlUtils

schema = {"name": {"type": "string"}, "enabled": {"type": "boolean"}}

data = YamlUtils.load_yaml_file("config.yaml")
YamlUtils.validate_yaml(data, schema)
YamlUtils.save_yaml_file("output.yaml", data, validate=True, schema=schema)

Development Setup

Clone the repo and install dependencies:

git clone https://github.com/roelkist/darca-yaml
cd darca-yaml
make install

Run checks before committing:

make check

Run individual targets (faster iteration):

make format
make test
make precommit
make docs

Contribution Guide

We welcome contributions via pull requests to main. Please see the CONTRIBUTING.rst file for detailed instructions.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darca_yaml-0.2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

darca_yaml-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file darca_yaml-0.2.0.tar.gz.

File metadata

  • Download URL: darca_yaml-0.2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for darca_yaml-0.2.0.tar.gz
Algorithm Hash digest
SHA256 070a737c2d758bf4f9ca514144b2366d8318800c07f79785d47d0747f835e9d8
MD5 63bc3f64d0447a399dc5f153329d78fb
BLAKE2b-256 8ee4954dbb92fe41ca4c786f9df74ee80d124dd21caae74e1f4556a4d13b34d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for darca_yaml-0.2.0.tar.gz:

Publisher: cd.yml on roelkist/darca-yaml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file darca_yaml-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: darca_yaml-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for darca_yaml-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b69b19b80377c19c6e118968d809a627afec55e50e3a619c3ef612eb1fba842c
MD5 8ac7bf621cab344c691b8fb261e83dc0
BLAKE2b-256 7f1770c1fa5bb3a063467dae4cbcaf15e6dfb0297d973e78d7c0f31caebc9626

See more details on using hashes here.

Provenance

The following attestation bundles were made for darca_yaml-0.2.0-py3-none-any.whl:

Publisher: cd.yml on roelkist/darca-yaml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page