Stencila for Python
This package isn't on PyPI yet, but you can install it this repository using using
pip install --user https://github.com/stencila/py/archive/master.zip
Note If you have Anaconda installed on your system, you should install the package using the following command:
pip install https://github.com/stencila/py/archive/master.zip
This will install
stencila in your Anaconda directory (where it should be), rather than in your local user Python libraries directory.
If you don't do that (i.e. get the
stencila package installed in your local user Python libraries), when you try to register
package (see below), you will get an error as your Anaconda Python will search for
stencila and its dependencies in the Anaconda directory.
Then install the package so that other Stencila packages and applications can detect it:
python -m stencila register
or, for older versions of Python you may need to do:
python -c "import stencila; stencila.register()"
Note If the default Python on your machine is Python 2.7 whilst you have Python 3.6 installed and you would like to use it with Stencila, then you need
pip3 and then register it explicitly using
pip3 install --user https://github.com/stencila/py/archive/master.zip
python3 -m stencila register
This package lets you run Python code (and other languages) from inside Stencila Documents. When you start the Stencila Desktop, the Stencila Python package will be automatically detected by the dektop app and you'll be able to execute Python code cells from within your documents.
In addition to the a
PythonContext class, this packages also provides a
SQLiteContext for executing SQL within an SQLite database (currently only an in-memory database).
More documentation is available at http://stencila-for-python.readthedocs.io
Most development tasks can be run using the usual Python toolchain or via
|Run tests with coverage||
|Run for manual testing||
During development a its handy to have
pytest installed and run individual test file from the root directory like this:
python -m pytest tests/test_python_context.py
Or run all the tests:
python -m pytest tests
For the automation and standardisation of testing across Python versions we use
make test (or just
tox) will build the package and run the test suite.