yatiml

Python library for YAML type inference, schema checking and syntactic sugar.

1
contributor
Get started
342 commitsLast commit ≈ 9 months ago9 stars4 forks

Cite this software

What yatiml can do for you

  • Lets you describe a document format/object model by defining Python classes
  • Checks YAML input against your format/model
  • Applies transformations that make the YAML file easier to read and write
  • Constructs Python objects from YAML in your format
  • Saves Python objects to YAML in your format

YAML-based file formats can be very handy, as YAML is easy to write by humans, and parsing support for it is widely available. Just read your YAML file into a document structure (a tree of nested dicts and lists), and manipulate that in your code.

While this works fine for simple file formats, it does not scale very well to more complex file formats such as the Common Workflow Language (CWL) or the Multiscale Computing Language (yMCL). Manual error-checking is lots of work and error-prone, defaults are not set automatically (which is especially tricky if you have multiple nested optional objects), and the file format often ends up somewhat underspecified.

Furthermore, a small collection of nested dicts and lists may work fine, but for more complex file formats, this becomes unwieldy and a set of objects is a better choice. Although it is not often used this way, YAML is actually a fully fledged object-to-text serialisation protocol. The Python yaml and ruamel.yaml libraries will actually construct objects for you, but the class names need to be put in the YAML file for that to work, which makes those files harder to read and write for humans.

YAtiML is a helper library that helps address these issues. With YAtiML, you have easy-to-read YAML for the user, and easy-to-use objects for the programmer, with validation and automatic type recognition in between.

Keywords
No keywords available
Programming language
  • Python 100%
License
</>Source code

Participating organisations

Netherlands eScience Center
University of Amsterdam
Vrije Universiteit Amsterdam

Contributors

Related projects

Muscle4MUSCLE

Sustaining and improving the MUSCLE3 model coupling framework

Updated 8 months ago
In progress

Googling the cancer genome

Identification and prioritization of cancer-causing structural variations in whole genomes

Updated 1 month ago
Finished

e-MUSC

Enhancing multiscale computing with sensitivity analysis and uncertainty quantification

Updated 25 months ago
Finished

Enhancing Protein-Drug Binding Prediction

Combining molecular simulation and eScience technologies

Updated 1 month ago
Finished

Related software

MUSCLE3

MU

MUSCLE3 is a coupling library for building multiscale simulations out of single-scale models.

Updated 14 months ago
6 4

sv-gen

SV

Highly portable parallel workflow to generate artificial genomes with structural variants.

Updated 29 months ago
5