jupyterlab-multicontents-templates


Namejupyterlab-multicontents-templates JSON
Version 0.4.2 PyPI version JSON
download
home_pagehttps://github.com/lydian/jupyterlab_multicontents_templates
SummaryJupyterlab templates from different types of contentsmanager
upload_time2024-03-29 00:42:37
maintainerNone
docs_urlNone
authorLydian Lee
requires_python>=3.6
licenseBSD-3-Clause
keywords jupyter jupyterlab jupyterlab3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # jupyterlab_multicontents_templates

![Github Actions Status](https://github.com/lydian/jupyterlab_multicontents_templates/workflows/Build/badge.svg)

Inspired by [Jupyterlab-templates](https://pypi.org/project/jupyterlab-templates/) but added extra functions:
1. Allow templates from any location, including S3, GCS, psql, etc., just installed the required jupyter contents manager.
2. Preview notebook before import the template
3. Directly publish notebook as templates into the selected folder with name
4. Share Template URL and directly opened preview

This extension is composed of a Python package named `jupyterlab_multicontents_templates`
for the server extension and a NPM package named `jupyterlab_multicontents_templates`
for the frontend extension.


## Screenshots
- Use Template with preview
![JupyterLab-template-demo](https://user-images.githubusercontent.com/678485/111886962-014bb700-898f-11eb-9a61-ffe86ff7be36.gif)

- Publish notebook to Templates
![JupyterLab-publish-demo](https://user-images.githubusercontent.com/678485/111886966-07419800-898f-11eb-83dd-a83a5b0c5f3b.gif)

- Share Templates
![jupyterlab-share-demo](https://user-images.githubusercontent.com/678485/112735948-5302bd00-8f0c-11eb-97b3-4eac2d74ed41.gif)


## Requirements

* JupyterLab >= 3.0

## Install

```bash
pip install jupyterlab_multicontents_templates
```

## Config

configure `jupyter_notebook_config.py` with the following settings:

```python
import os
from IPython.html.services.contents.filemanager import FileContentsManager
from s3contents import S3ContentsManager

c.JupyterLabMultiContentsTemplates.template_folders = {
    "templates from Local File": {
        "manager_class": FileContentsManager,
        "kwargs": {
            "root_dir": os.environ["HOME"]
        },
    },
    "templates from S3 prefix1": {
        "manager_class": S3ContentsManager,
        "kwargs": {
            "bucket": "example-bucket",
            "prefix": "path/to/notebooks",
        },
    },
    "templates from S3 prefix2": {
        "manager_class": S3ContentsManager,
        "kwargs": {
            "bucket": "another-example-bucket",
            "prefix": "path/to/notebooks",
        },
    },
}

# If you're using jupyterhub please set this value to True to enable sharing:
c.JupyterLabMultiContentsTemplates.append_hub_user_redirect = True
```

## Troubleshoot

If you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:

```bash
jupyter server extension list
```

If the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:

```bash
jupyter labextension list
```


## Contributing

### Development install

Note: You will need NodeJS to build the extension package.

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# Clone the repo to your local environment
# Change directory to the jupyterlab_multicontents_templates directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
```

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

```bash
jupyter lab build --minimize=False
```

### Uninstall

```bash
pip uninstall jupyterlab_multicontents_templates
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lydian/jupyterlab_multicontents_templates",
    "name": "jupyterlab-multicontents-templates",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "Jupyter, JupyterLab, JupyterLab3",
    "author": "Lydian Lee",
    "author_email": "lydianly@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/19/25/360bd0a410af754190a287917996afe16c763f64dd688b69908f03aa4d49/jupyterlab_multicontents_templates-0.4.2.tar.gz",
    "platform": "Linux",
    "description": "# jupyterlab_multicontents_templates\n\n![Github Actions Status](https://github.com/lydian/jupyterlab_multicontents_templates/workflows/Build/badge.svg)\n\nInspired by [Jupyterlab-templates](https://pypi.org/project/jupyterlab-templates/) but added extra functions:\n1. Allow templates from any location, including S3, GCS, psql, etc., just installed the required jupyter contents manager.\n2. Preview notebook before import the template\n3. Directly publish notebook as templates into the selected folder with name\n4. Share Template URL and directly opened preview\n\nThis extension is composed of a Python package named `jupyterlab_multicontents_templates`\nfor the server extension and a NPM package named `jupyterlab_multicontents_templates`\nfor the frontend extension.\n\n\n## Screenshots\n- Use Template with preview\n![JupyterLab-template-demo](https://user-images.githubusercontent.com/678485/111886962-014bb700-898f-11eb-9a61-ffe86ff7be36.gif)\n\n- Publish notebook to Templates\n![JupyterLab-publish-demo](https://user-images.githubusercontent.com/678485/111886966-07419800-898f-11eb-83dd-a83a5b0c5f3b.gif)\n\n- Share Templates\n![jupyterlab-share-demo](https://user-images.githubusercontent.com/678485/112735948-5302bd00-8f0c-11eb-97b3-4eac2d74ed41.gif)\n\n\n## Requirements\n\n* JupyterLab >= 3.0\n\n## Install\n\n```bash\npip install jupyterlab_multicontents_templates\n```\n\n## Config\n\nconfigure `jupyter_notebook_config.py` with the following settings:\n\n```python\nimport os\nfrom IPython.html.services.contents.filemanager import FileContentsManager\nfrom s3contents import S3ContentsManager\n\nc.JupyterLabMultiContentsTemplates.template_folders = {\n    \"templates from Local File\": {\n        \"manager_class\": FileContentsManager,\n        \"kwargs\": {\n            \"root_dir\": os.environ[\"HOME\"]\n        },\n    },\n    \"templates from S3 prefix1\": {\n        \"manager_class\": S3ContentsManager,\n        \"kwargs\": {\n            \"bucket\": \"example-bucket\",\n            \"prefix\": \"path/to/notebooks\",\n        },\n    },\n    \"templates from S3 prefix2\": {\n        \"manager_class\": S3ContentsManager,\n        \"kwargs\": {\n            \"bucket\": \"another-example-bucket\",\n            \"prefix\": \"path/to/notebooks\",\n        },\n    },\n}\n\n# If you're using jupyterhub please set this value to True to enable sharing:\nc.JupyterLabMultiContentsTemplates.append_hub_user_redirect = True\n```\n\n## Troubleshoot\n\nIf you are seeing the frontend extension, but it is not working, check\nthat the server extension is enabled:\n\n```bash\njupyter server extension list\n```\n\nIf the server extension is installed and enabled, but you are not seeing\nthe frontend extension, check the frontend extension is installed:\n\n```bash\njupyter labextension list\n```\n\n\n## Contributing\n\n### Development install\n\nNote: You will need NodeJS to build the extension package.\n\nThe `jlpm` command is JupyterLab's pinned version of\n[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use\n`yarn` or `npm` in lieu of `jlpm` below.\n\n```bash\n# Clone the repo to your local environment\n# Change directory to the jupyterlab_multicontents_templates directory\n# Install package in development mode\npip install -e .\n# Link your development version of the extension with JupyterLab\njupyter labextension develop . --overwrite\n# Rebuild extension Typescript source after making changes\njlpm run build\n```\n\nYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.\n\n```bash\n# Watch the source directory in one terminal, automatically rebuilding when needed\njlpm run watch\n# Run JupyterLab in another terminal\njupyter lab\n```\n\nWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).\n\nBy default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:\n\n```bash\njupyter lab build --minimize=False\n```\n\n### Uninstall\n\n```bash\npip uninstall jupyterlab_multicontents_templates\n```\n\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Jupyterlab templates from different types of contentsmanager",
    "version": "0.4.2",
    "project_urls": {
        "Homepage": "https://github.com/lydian/jupyterlab_multicontents_templates"
    },
    "split_keywords": [
        "jupyter",
        " jupyterlab",
        " jupyterlab3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d5587e6a1abd710670529b596b7df4c319a52cc57c0181b606638aafe217fe5",
                "md5": "fbd8382639f0e357f1a443317f5ac13d",
                "sha256": "f021bef1e507193aa695855c1a4cf178dc5bbdb90c0e005f3eff483c41aa84c6"
            },
            "downloads": -1,
            "filename": "jupyterlab_multicontents_templates-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fbd8382639f0e357f1a443317f5ac13d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 35204,
            "upload_time": "2024-03-29T00:42:36",
            "upload_time_iso_8601": "2024-03-29T00:42:36.022837Z",
            "url": "https://files.pythonhosted.org/packages/7d/55/87e6a1abd710670529b596b7df4c319a52cc57c0181b606638aafe217fe5/jupyterlab_multicontents_templates-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1925360bd0a410af754190a287917996afe16c763f64dd688b69908f03aa4d49",
                "md5": "5c762aa39dcbc19d864d17bef3a5125a",
                "sha256": "8d8a853ec08861ba3dd1080bdac1323ff0a03e15f7ce3ec1c89f1a84d1654ba4"
            },
            "downloads": -1,
            "filename": "jupyterlab_multicontents_templates-0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5c762aa39dcbc19d864d17bef3a5125a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 110549,
            "upload_time": "2024-03-29T00:42:37",
            "upload_time_iso_8601": "2024-03-29T00:42:37.791466Z",
            "url": "https://files.pythonhosted.org/packages/19/25/360bd0a410af754190a287917996afe16c763f64dd688b69908f03aa4d49/jupyterlab_multicontents_templates-0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 00:42:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lydian",
    "github_project": "jupyterlab_multicontents_templates",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "jupyterlab-multicontents-templates"
}
        
Elapsed time: 0.21269s