{"id":21044984,"url":"https://github.com/quansight/nb_conda_store_kernels","last_synced_at":"2025-05-15T17:33:20.071Z","repository":{"id":40587902,"uuid":"507662615","full_name":"Quansight/nb_conda_store_kernels","owner":"Quansight","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-15T23:45:31.000Z","size":41,"stargazers_count":2,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-07-25T09:52:33.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quansight.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-06-26T19:11:40.000Z","updated_at":"2023-04-19T21:52:58.000Z","dependencies_parsed_at":"2022-08-27T20:31:11.449Z","dependency_job_id":"3e1baf2a-75e3-4baf-8831-922c2e3453f2","html_url":"https://github.com/Quansight/nb_conda_store_kernels","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"5b86216a3847ebd3dc85dacd350860768c365b81"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fnb_conda_store_kernels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fnb_conda_store_kernels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fnb_conda_store_kernels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fnb_conda_store_kernels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quansight","download_url":"https://codeload.github.com/Quansight/nb_conda_store_kernels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225366317,"owners_count":17463020,"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-19T14:19:24.715Z","updated_at":"2024-11-19T14:19:26.233Z","avatar_url":"https://github.com/Quansight.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nb_conda_store_kernels\n\nThis extension enables a Jupyter Notebook or JupyterLab application to access environments stored in Conda-Store and run kernels for Python, R, and other languages. When a kernel from an external environment is selected, the environment is downloaded, extracted, conda environment is automatically activated, and finally the kernel is launched. This package was heavily inspired by [nb_conda_kernels](https://github.com/Anaconda-Platform/nb_conda_kernels).\n\nAny notebook launched via a `nb_conda_store_kernel` kernel will have\nnotebook metadata about the environment used. This provides a powerful\nmechanism for running the notebook later in a reproducible way.\n\n```\n{\n    ...,\n    \"kernelspec\": {\n        ...,\n        \"name\": \"conda-store://\u003cnamespace\u003e/\u003cenvironment_name\u003e:\u003cbuild-id\u003e\",\n        ...,\n    },\n    ...\n}\n```\n\nThe package works by defining a custom KernelSpecManager that calls the Conda-Store REST API for available conda environments with required packages. It dynamically modifies each KernelSpec so that it can be properly run from the notebook environment. When you create a new notebook, these modified kernels will be made available in the selection list. Additionally without [Conda-Pack](https://conda.github.io/conda-pack/)\n\n## Usage\n\nThis package does not need `pip` or `conda` to run properly but\ncurrently only run on Linux. It should be installed in the environment\nfrom which you run Jupyter Notebook or JupyterLab. It is recommended\nfor install `nb_conda_store_kernsl` via Conda due to activation hooks\nwhich simplify the installation but there is no strong reason to use\nconda.\n\n```shell\nconda install -c conda-forge nb_conda_store_kernels\n```\n\nAlternatively `pip` works as well but requires one additional step.\n\n```shell\npip install nb_conda_store_kernels\npython -m nb_conda_store_kernels.install --enable\n# python -m nb_conda_store_kernels.install --disable # to disable\n```\n\n`python -m nb_conda_store_kernels.install --enable` simply modifies a\nsingle jupyter setting. If that did not work (it should and is a bug\nif not) you need to add the following setting to `jupyter_config.py`.\n\n```shell\nmkdir ~/.jupyter\necho 'c.JupyterApp.kernel_spec_manager_class = \"nb_conda_store_kernels.manager.CondaStoreKernelSpecManager\"' \u003e ~/.jupyter/jupyter_conifg.py\n```\n\nIn order to `nb_conda_store_kernels` to connect properly to\nConda-Store it needs several environment variables set. Under the\ncovers `conda-store` the client is being using and has [detailed\ndocumentation](https://github.com/quansight/conda-store/conda-store)\non configuration.\n\n```\nexport CONDA_STORE_URL=http(s)://...\nexport CONDA_STORE_AUTH=none|basic|token\n# export CONDA_STORE_USERNAME=... # using basic auth \n# export CONDA_STORE_PASSWORD=... # using basic auth\n# export CONDA_STORE_TOKEN=...    # using token auth\n```\n\nFinally launch JupyterLab!\n\n```shell\njupyter lab\n```\n\n### Connecting to existing conda-store server\n\nVisit conda-store server you are using and get a token for your given\nuser via vising the `/user` endpoint after you login.\n\n```shell\ndocker run -p 8888:8888 -e CONDA_STORE_TOKEN=... quansight/nb-conda-store-kernels:v0.1.5\n```\n\n### Use with nbconvert, voila, papermill,...\n\nSince `nb_conda_store_kernels` uses the `conda-store` client under the\ncovers these use cases are supported by the client with proper\nenvironment variables being set. There are plans to extend other tools\nto use Conda-Store.\n\n```shell\nconda-store run namespace/environment -- python -c \"print('Hello, Conda-Store!')\"\n```\n\n## Development\n\nStart Conda-Store server\n\n```\ndocker-compose up --build\njupyter lab\n```\n\nLogin to Conda-Store at [localhost:5000](http://localhost:5000) and\ncreate a new environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansight%2Fnb_conda_store_kernels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquansight%2Fnb_conda_store_kernels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansight%2Fnb_conda_store_kernels/lists"}