π PylaΒΆ
Python interpreter for executable documentsΒΆ
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` <https://github.com/stencila/executa>`_ installed then you can run it using the repl
command and specifying python
as the starting language,
executa repl python
DevelopΒΆ
setupΒΆ
To install the packages needed for development, run make setup
or,
pip3 install --user --upgrade -r requirements-dev.txt
Code formattingΒΆ
We use Black to maintain a consistent code formatting style. To run it use black .
or make format
.
RunningΒΆ
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]