Skip to main content

Package description here.

Project description

databind.yaml

Databind is a library inspired by Jackson-databind to describe and bind data models for object-oriented programming. The databind.yaml module provides functionality to (de-) serialize YAML payloads from/to Python objects.

Note: This module is just a thin wrapper that provides utility functions, combining the functionality of databind.json with PyYAML.

Quickstart

from typing import Optional
from databind.core import datamodel
from databind.yaml import from_str

@datamodel
class Geolocation:
  latitude: float
  longitude: float
  altitude: Optional[float] = None

@datamodel
class ResolvedLocation:
  query: str
  location: Geolocation

london = from_str(ResolvedLocation, '''
query: London
location:
  latitude: 51.507351
  longitude: -0.127758
''')

assert london == ResolvedLocation("London", Geolocation(51.507351, -0.127758))

Copyright © 2020 Niklas Rosenstein

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

databind.yaml-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

databind.yaml-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file databind.yaml-0.1.0.tar.gz.

File metadata

  • Download URL: databind.yaml-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.10

File hashes

Hashes for databind.yaml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 75342cb5a4e7d7f74078a6966e350ad4e1243cb5f4f68746f5cc5b5ea050ad7f
MD5 670bd07e84ada44a4a071d35fc3d42ed
BLAKE2b-256 e3c3c5a2e28172bd0aa2f4f5f109a35c78891ab6bcc3d5ebca01e18bd8e35374

See more details on using hashes here.

File details

Details for the file databind.yaml-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: databind.yaml-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.10

File hashes

Hashes for databind.yaml-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 664a772dfd51174370dbc526591c74566f4aaf7cbfae46bcbc908551726034c2
MD5 e1eaadfddf0ac90443fc92880e5e297b
BLAKE2b-256 92082b1c3193a14d1bb52ab0fdffd1ff9de208bfae14a74c3f5289a09d3e45f9

See more details on using hashes here.

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