Skip to main content

pyyaml-typed

Build Status codecov PyPI version GitHub

Library providing dump and load functions for pyyaml supporting go-yaml-like description of yaml fields as class comments

Dataclasses and named tuples can be used without defining field names. Field in comment for them will override default class field name

Example:

from tyaml import dump

@dataclass
class Something:
    my_fld_1: int
    # or use `yaml:` comment to rename
    field2: str  # yaml: my_fld_2
    
output = dump([Something(1, "that's"), Something(2, "nice")])

will create yaml:

- my_fld_1: 1
  my_fld_2: "that's"
- my_fld_1: 2
  my_fld_2: "nice"

and in the opposite direction:

from typing import List

from tyaml import load

loaded = load(yml_str, List[Something])
loaded == [Something(1, "that's"), Something(2, "nice")]

Metadata

Release files for pyyaml-typed 0.1.3

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

Source distribution (sdist)

Source distribution for pyyaml-typed 0.1.3
File Size Uploaded
pyyaml-typed-0.1.3.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyyaml-typed 0.1.3
File Interpreter ABI Platform
pyyaml_typed-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / pyyaml-typed-0.1.3.tar.gz

Download URL pyyaml-typed-0.1.3.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5ec3069b003c9baab17062881976044bdfadb927810f4277f04678c0c1f47eee
BLAKE2b-256 checksum
How to use checksums
61dccfa2102e4df8e5f0519e7a5695ad6a55bd33c89d01608924e3f52eeb5ff9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1032-gcp

Release files / pyyaml_typed-0.1.3-py3-none-any.whl

Download URL pyyaml_typed-0.1.3-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c330561e12008b619d406eb3bd69d09529f00614f571f4b7e47e4ae1e0965a7b
BLAKE2b-256 checksum
How to use checksums
09fdccd409793d30eb4019c05d644c065fed54ce962f52648c6aac5c48eb9343
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1032-gcp

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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