{"id":21070386,"url":"https://github.com/stencila/py","last_synced_at":"2025-05-16T05:30:47.146Z","repository":{"id":146684474,"uuid":"68074039","full_name":"stencila/py","owner":"stencila","description":"Stencila for Python","archived":false,"fork":false,"pushed_at":"2018-08-03T20:57:01.000Z","size":305,"stargazers_count":17,"open_issues_count":8,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T20:37:35.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stencila.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-13T04:24:42.000Z","updated_at":"2019-01-20T09:31:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfad56b2-2fca-4ff9-baaf-351d35d1aca2","html_url":"https://github.com/stencila/py","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Fpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Fpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Fpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stencila%2Fpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stencila","download_url":"https://codeload.github.com/stencila/py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254473770,"owners_count":22077167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T18:46:45.140Z","updated_at":"2025-05-16T05:30:47.139Z","avatar_url":"https://github.com/stencila.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Stencila for Python\n\n[![Build status](https://travis-ci.org/stencila/py.svg?branch=master)](https://travis-ci.org/stencila/py)\n[![Code coverage](https://codecov.io/gh/stencila/py/branch/master/graph/badge.svg)](https://codecov.io/gh/stencila/py)\n[![Documentation](https://readthedocs.org/projects/stencila-for-python/badge/)](http://stencila-for-python.readthedocs.io)\n[![Community](https://img.shields.io/badge/join-community-green.svg)](https://community.stenci.la)\n[![Chat](https://badges.gitter.im/stencila/stencila.svg)](https://gitter.im/stencila/stencila)\n\n### Install\n\nThis package isn't on PyPI yet, but you can install it this repository using using `pip`:\n\n```bash\npip install --user --upgrade https://github.com/stencila/py/archive/master.zip\n```\n\n**Note** If you have [Anaconda](https://www.anaconda.com/) installed on your system, you should install the package using the following command:\n\n```bash\npip install --upgrade https://github.com/stencila/py/archive/master.zip\n```\n\nThis will install `stencila` in your Anaconda directory (where it should be), rather than in your local user Python libraries directory.\nIf you don't do that (i.e. get the `stencila` package installed in your local user Python libraries), when you try to register `stencila`\npackage (see below), you will get an error as your Anaconda Python will search for `stencila` and its dependencies in the Anaconda directory.   \n\nThen install the package so that other Stencila packages and applications can detect it:\n\n\n```bash\npython -m stencila register\n```\n\nor, for older versions of Python you may need to do:\n\n```bash\npython -c \"import stencila; stencila.register()\"\n```\n\n**Note** If the default Python on your machine is Python 2.7 but you have Python 3.x also installed and would like to use that version with Stencila, then you need to install `stencila` using `pip3` and register it explicitly using `python3`:\n\n```bash\npip3 install --user --upgrade https://github.com/stencila/py/archive/master.zip\n```\n\n```bash\npython3 -m stencila register\n```\n\n\n### Use\n\nThis package lets you run Python code (and other languages) from inside Stencila Documents. When you start the [Stencila Desktop](https://github.com/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.\n\nIn 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).\n\nMore documentation is available at http://stencila-for-python.readthedocs.io\n\n### Discuss\n\nWe love feedback. Create a [new issue](https://github.com/stencila/py/issues/new), add to [existing issues](https://github.com/stencila/py/issues) or [chat](https://gitter.im/stencila/stencila) with members of the community.\n\n### Develop\n\nMost development tasks can be run using the usual Python toolchain or via `make` shortcuts.\n\nTask                                                    | `make`       |   Python tooling      \n------------------------------------------------------- |--------------|--------------------------\nInstall dependencies                                    | `make setup` | `pip install ...`       \nRun tests                                               | `make test`  | `tox`       \nRun tests with coverage                                 | `make cover` | `tox -e cover`              \nBuild                                                   | `make build` | `./setup.py bdist_wheel`\nBuild documentation                                     | `make docs`  | `make -C docs html`\nRun for manual testing                                  | `make run`   | `python -m stencila`\nClean                                                   | `make clean` | `rm -rf ...`\n\nTo get started, please read our contributor [code of conduct](CONDUCT.md), then [get in touch](https://gitter.im/stencila/stencila) or checkout the [platform-wide, cross-repository kanban board](https://github.com/orgs/stencila/projects/1), or just send in a pull request!\n\nDuring development a its handy to have `pytest` installed and run individual test file from the root directory like this:\n\n```\npython -m pytest tests/test_python_context.py\n```\n\nOr run all the tests:\n\n```\npython -m pytest tests\n```\n\nFor the automation and standardisation of testing across Python versions we use [`tox`](https://tox.readthedocs.io/en/latest/). Running `make test` (or just `tox`) will build the package and run the test suite.\n\nTests are run on [Travis](https://travis-ci.org/stencila/py) and code coverage tracked at [Codecov](https://codecov.io/gh/stencila/py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstencila%2Fpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstencila%2Fpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstencila%2Fpy/lists"}