All Projects → jacebrowning → yorm

jacebrowning / yorm

Licence: other
Automatic object-YAML mapping for Python.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to yorm

Datafiles
A file-based ORM for Python dataclasses.
Stars: ✭ 113 (+391.3%)
Mutual labels:  yaml, orm, filesystem
Korio
Korio: Kotlin cORoutines I/O : Virtual File System + Async/Sync Streams + Async TCP Client/Server + WebSockets for Multiplatform Kotlin 1.3
Stars: ✭ 282 (+1126.09%)
Mutual labels:  yaml, filesystem
Shrine
File Attachment toolkit for Ruby applications
Stars: ✭ 2,903 (+12521.74%)
Mutual labels:  orm, filesystem
Java Library Examples
💪 example of common used libraries and frameworks, programming required, don't fork man.
Stars: ✭ 204 (+786.96%)
Mutual labels:  yaml, orm
graphql-tutorial
Tutorial for GraphQL
Stars: ✭ 24 (+4.35%)
Mutual labels:  orm
Sworm
CoreData based Swift ORM
Stars: ✭ 70 (+204.35%)
Mutual labels:  orm
storm
🌐⚡️LocalStorage manager library for JavaScript
Stars: ✭ 14 (-39.13%)
Mutual labels:  orm
MeowVapor
Meow plugin for API generation
Stars: ✭ 12 (-47.83%)
Mutual labels:  orm
home assistant config
HomeAssistant.io Configuration Files
Stars: ✭ 110 (+378.26%)
Mutual labels:  yaml
corma
Convention-based Object-Relational Mapper
Stars: ✭ 28 (+21.74%)
Mutual labels:  orm
HomeAssistant
My Home Assistant Configuration
Stars: ✭ 71 (+208.7%)
Mutual labels:  yaml
milestoner
A command line interface for crafting Git repository milestones.
Stars: ✭ 27 (+17.39%)
Mutual labels:  version-control
go-mtree
File systems verification utility and library, in likeness of mtree(8)
Stars: ✭ 55 (+139.13%)
Mutual labels:  filesystem
fsharp-dapper
The wrapper above the 'Dapper' library allows you to write more familiar code in the F # language. It also contains a functional for more simple work with temporary tables
Stars: ✭ 72 (+213.04%)
Mutual labels:  orm
storage
Go package for abstracting local, in-memory, and remote (Google Cloud Storage/S3) filesystems
Stars: ✭ 49 (+113.04%)
Mutual labels:  filesystem
DroidFS
Encrypted overlay filesystems implementation for Android. Also available on gitea: https://forge.chapril.org/hardcoresushi/DroidFS
Stars: ✭ 152 (+560.87%)
Mutual labels:  filesystem
wip
WIP & naenae: CLI utilities to easily manage Work In Progress with Git
Stars: ✭ 46 (+100%)
Mutual labels:  version-control
gulp-yaml
A Gulp plugin to convert YAML to JSON
Stars: ✭ 24 (+4.35%)
Mutual labels:  yaml
monalisa-orm
Very Simple ORM
Stars: ✭ 70 (+204.35%)
Mutual labels:  orm
tree-sitter-yaml
YAML grammar for tree-sitter
Stars: ✭ 29 (+26.09%)
Mutual labels:  yaml

Build Status Coverage Status Scrutinizer Code Quality PyPI Version

Overview

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

NOTE: This project is now in maintenance mode. Please check out datafiles, its spiritual successor.

Requirements

  • Python 3.5+

Installation

Install YORM with pip:

$ pip install YORM

or directly from the source code:

$ git clone https://github.com/jacebrowning/yorm.git
$ cd yorm
$ python setup.py install

Usage

Simply take an existing class:

class Student:
    def __init__(self, name, school, number, year=2009):
        self.name = name
        self.school = 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)
@yorm.sync("students/{self.school}/{self.number}.yml")
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
1.8
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].