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
Register Pyla so that it can be discovered by other executors on your machine,
python3 -m stencila.pyla register
Then, if you have executa
installed then you can run it using the repl
command and specifying python
as the starting language,
executa repl python
Alternatively, you can use Pyla directly to execute documents:
$ 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 two 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.
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.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a6314150ae578f82ca6380c6410c96af46f74dc1764edd6f392b46c56c529f8 |
|
MD5 | 038eb0d2c80f796639e3e1bcd54f2c30 |
|
BLAKE2b-256 | 5b16c2ef8e68e9b071a5ebc9f675362725f7777dbd68073839eab84f42184e38 |