Python Yaml Object deserializer based on PyYAML.


Keywords
YAML, serialization, deserialization, parser, python, schema, validation
License
WTFPL
Install
pip install pofy==1.0.0

Documentation

Pofy (Python yaml objects)

WTFPL license Actions Status Coverage Status

Overview

Pofy is a tiny library allowing to declare classes that can be deserialized from YAML, using pyyaml. Classes declares a schema as a list of fields, used to check for data validation during deserialization.

Pofy is distributed under the term of the WTFPL V2 (See COPYING file).

Installation

Pofy is tested with Python 3.8. It be installed through pip :

pip install pofy

Quickstart

To use Pofy, you must declare a schema in the class you want to deserialize :

    from pofy import StringField, load

    class SomeObject:
        class Schema:
            field = StringField()

    deserialized_object = load(SomeObject, 'field: value')
    assert deserialized_object.field == 'value`