preserves/implementations/python/docs/index.md

1.3 KiB

Overview

This package implements Preserves for Python 3.x. It provides the core semantics as well as both the human-readable text syntax (a superset of JSON) and machine-oriented binary format (including canonicalization) for Preserves. It also implements Preserves Schema and Preserves Path.

What is Preserves?

{% include "what-is-preserves.md" %}

Mapping between Preserves values and Python values

Preserves Values are categorized in the following way:

{% include "value-grammar.md" %}

Python's strings, byte strings, integers, booleans, and double-precision floats stand directly for their Preserves counterparts. Small wrapper classes for Float and Symbol complete the suite of atomic types.

Python's lists and tuples correspond to Preserves Sequences, and dicts and sets to Dictionary and Set values, respectively. Preserves Records are represented by a Record class. Finally, embedded values are represented by a small Embedded wrapper class.