No project description provided
Project description
Stencila Schema Bindings for Python
This is the Python implementation of Schema types for Stencila Schema.
Types
Types are defined in types.py
.
Utilities
To support conversion of Stencila types to/from JSON (via dict
), util.py
defines to_dict
, from_dict
,
to_json
and from_json
functions.
Example Python to JSON
from stencila.schema.types import Heading
from stencila.schema.util import to_json
h2 = Heading(["Heading Text"], 2)
serialized = to_json(h2)
# {"type": "heading", "content": ["Heading Text"], "depth": 2}
Example JSON to Python
from stencila.schema.util import from_json
serialized = """{"type": "Heading", "content": ["Heading Text"], "depth": 2}"""
h2 = from_json(serialized)
Interpreter
Executing/interpreting executable documents has been moved to its own project, Pyla.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stencila-schema-0.29.0.tar.gz
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for stencila_schema-0.29.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a463ad894c06de19bd4503eaa69bcd640bf94d79f2beff46c8941e4354742d29 |
|
MD5 | 9d0bef036f6178bc833171a5a9d88027 |
|
BLAKE2b-256 | f5a5da5c59381bb78f5efb25661f17e05ce609860e9db5f5b1f2a36de02aff99 |