Skip to main content

StrictYAML is a YAML parser that forces you to explicitly type your YAML with a schema before parsing it, eliminating parse surprise bugs caused by implicit typing.

For example:

- Don Corleone: Do you have faith in my judgment?
- Clemenza: Yes
- Don Corleone: Do I have your loyalty?

Parse output of pyyaml/ruamel.yaml:

>>> from ruamel.yaml import load
>>> load(the_godfather)
[{'Don Corleone': 'Do you have faith in my judgement?'},
 {'Clemenza': True},
 {'Don Corleone': 'Do I have your loyalty?'},]

Wait, Clemenza said what??

Parse output of StrictYAML:

>>> from strictyaml import load, List, MapPattern, Str
>>> load(the_godfather, List(MapPattern({Str(), Str()})))
[{'Don Corleone': 'Do you have faith in my judgement?'},
 {'Clemenza': 'Yes'},
 {'Don Corleone': 'Do I have your loyalty?'},]

Why use StrictYAML?

YAML is an excellent metalanguage to describe most kinds of configuration. It is terse and devoid of noisy syntax (unlike JSON), able to clearly represent hierarchical data (unlike INI) and most important of all, it’s not the product of a crazed committee of monkeys hammering away on typewriters (XML).

YAML has weaknesses, however, which StrictYAML addresses:

  • Implicitly typed (StrictYAML fixes this with explicit typing).

  • Allows arbitrary binary data leading to, among other things, Ruby on Rails’ spectacular [security fail](http://www.h-online.com/open/news/item/Rails-developers-close-another-extremely-critical-flaw-1793511.html) (disallowed in StrictYAML because why on earth did anybody think this was a good idea?).

  • Tag tokens, allowing you to specify types in the YAML (disallowed in StrictYAML).

  • Confusing “flow” style (disallowed by default in StrictYAML).

  • Often confusing node anchors and references (disallowed by default in StrictYAML).

Using StrictYAML

>>> from strictyaml import load, Map, Str
>>> load(

Download files

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

Source Distribution

strictyaml-0.1.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file strictyaml-0.1.tar.gz.

File metadata

  • Download URL: strictyaml-0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for strictyaml-0.1.tar.gz
Algorithm Hash digest
SHA256 e6226f828f66db3c1f00c86a80458947701742a7df35f0f1b91b7fc9c756c77d
MD5 0ef91a1e93201ea344aa1bfdce342323
BLAKE2b-256 4dfcb6f484fbfe14ebbea85902d3e43e762dcb53d0d1a1dbd4196c0b867fb7c6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1

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