Skip to main content

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


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)

Uploaded Source

Built Distribution

stencila_schema-0.29.0-py2.py3-none-any.whl (33.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page