Python interpreter for Stencila
Project description
🐍 Pyla
Python interpreter for Stencila
This is the Python implementation of an interpreter capable of interpreting executable documents defined in JSON using Stencila Schema.
Install
Pyla is available as a Python package,
pip3 install stencila-pyla
Use
Once installed it can be used like this:
$ python3 -m stencila.pyla execute <inputfile> <outputfile> [parameters]
-
<inputfile>
and/or<outputfile>
can be set to-
to read from stdin and/or write to stdout (respectively). -
[parameters]
is a list of parameters to pass to the document –- these will differ based on what the document defines. They can be passed either by--parameter_name=parameter_value
or--parameter_name parameter_value
. Each parameter must be named.
Develop
There are three options to run the interpreter without installing this package (which can be useful when developing).
Use setup.py develop
Run python3 setup.py develop
which will link this library into your site packages directory. You can then execute
documents with the above command.
Run interpreter.py
directly
You can run the interpreter.py
script directly, the arguments are the same as running as a module in the example
above except the first execute
argument is omitted:
$ python3 stencila/pyla/interpreter.py <inputfile> <outputfile> [parameters]
Change into stencila
folder
You can run the interpreter as a module by changing into the stencila
directory first, and then omitting the
stencila
namespace:
$ cd stencila
$ python3 -m pyla execute <inputfile> <outputfile> [parameters]
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
Built Distribution
Hashes for stencila_pyla-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 051b9732ffd3196f6f502028367d806cc075f081387f5361ad5895e9f2d086d0 |
|
MD5 | 40e1f2f3fffa5646c6d71a79747640b6 |
|
BLAKE2b-256 | 22261b25bd99b95c897c6a90d85ded62da566a70ab2b3cf10e9397de5ecdff60 |