Build Status Coverage Status Scrutinizer Code Quality PyPI Version


YORM enables automatic, bidirectional, human-friendly mappings of object attributes to YAML files. Uses beyond typical object serialization and relational mapping include:

  • bidirectional conversion between basic YAML and Python types
  • attribute creation and type inference for new attributes
  • storage of content in text files optimized for version control
  • extensible converters to customize formatting on complex classes

View the talk from PyOhio 2015.


  • Python 3.3+


Install YORM with pip:

$ pip install YORM

or directly from the source code:

$ git clone
$ cd yorm
$ python install


Simply take an existing class:

class Student:
    def __init__(self, name, school, number, year=2009): = name = school
        self.number = number
        self.year = year
        self.gpa = 0.0

and define an attribute mapping:

import yorm
from yorm.types import String, Integer, Float

@yorm.attr(name=String, year=Integer, gpa=Float)
class Student:

Modifications to each object's mapped attributes:

>>> s1 = Student("John Doe", "GVSU", 123)
>>> s2 = Student("Jane Doe", "GVSU", 456, year=2014)
>>> s1.gpa = 3

are automatically reflected on the filesytem:

$ cat students/GVSU/123.yml
name: John Doe
gpa: 3.0
school: GVSU
year: 2009

Modifications and new content in each mapped file:

$ echo "name: John Doe
> gpa: 1.8
> year: 2010
" > students/GVSU/123.yml

are automatically reflected in their corresponding object:

>>> s1.gpa