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.2.tar.gz (3.3 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.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: databind.yaml-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for databind.yaml-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ebf93f37391ae0750f3c6132862faae5d625bbfcdd29fb56400d6c9b593a9323
MD5 042a51f477d30ce62da26279fbdea88e
BLAKE2b-256 4813f4a1dac682862547a9480a1eae27c8878ae74bd610d83cfa7287f9695fd7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: databind.yaml-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for databind.yaml-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb388c7b702be0542e7f9c799b8770d00335d3f5cfd5d09ff5d2f924c3f30a11
MD5 72b9853afa3aa39b23506c0e455644d2
BLAKE2b-256 afbb54ef9d3dca1e239c667205d5cd3298cf37bbc0ae618d53b15d250bd1603d

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