meta-nbextension


Namemeta-nbextension JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/answerdotai/meta-nbextension
SummaryAccess to current notebook and cell in an nbclassic notebook
upload_time2024-04-07 04:37:24
maintainerNone
docs_urlNone
authorJeremy Howard
requires_python>=3.6
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # meta-nbextension

This is an nbextension for Jupyter Notebook (nbclassic) v6. It doesn't work for the latest v7 which is a skin of
Jupyter Lab.

After installing it, all notebooks will have an `nbmeta` variable automatically created and kept updated, which
contains the current cell index and notebook name. This has only been tested inside regular notebook execution; it
might not work in other contexts, such as nbconvert.

In addition, the `set_next_input` js payload is modified to take an optional `ctype` argument, for the cell type to
create (i.e. 'code' or 'markdown'). This function can be used to access this functionality:

```python
def set_next_cell(text, code=True, replace=False, execute=False):
    if not code: execute=True
    ip.payload_manager.write_payload(dict(
        source='set_next_input',
        replace=replace, execute=execute,
        text=text, ctype='code' if code else 'markdown'))
```

## Installation

```
pip install meta-nbextension
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/answerdotai/meta-nbextension",
    "name": "meta-nbextension",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Jeremy Howard",
    "author_email": "info@fast.ai",
    "download_url": "https://files.pythonhosted.org/packages/0c/8c/38da16a77073a3b4d14ad3f9155cf8cfa43d706ceae819424d43f66cf579/meta-nbextension-0.1.1.tar.gz",
    "platform": null,
    "description": "# meta-nbextension\n\nThis is an nbextension for Jupyter Notebook (nbclassic) v6. It doesn't work for the latest v7 which is a skin of\nJupyter Lab.\n\nAfter installing it, all notebooks will have an `nbmeta` variable automatically created and kept updated, which\ncontains the current cell index and notebook name. This has only been tested inside regular notebook execution; it\nmight not work in other contexts, such as nbconvert.\n\nIn addition, the `set_next_input` js payload is modified to take an optional `ctype` argument, for the cell type to\ncreate (i.e. 'code' or 'markdown'). This function can be used to access this functionality:\n\n```python\ndef set_next_cell(text, code=True, replace=False, execute=False):\n    if not code: execute=True\n    ip.payload_manager.write_payload(dict(\n        source='set_next_input',\n        replace=replace, execute=execute,\n        text=text, ctype='code' if code else 'markdown'))\n```\n\n## Installation\n\n```\npip install meta-nbextension\n```\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Access to current notebook and cell in an nbclassic notebook",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/answerdotai/meta-nbextension"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e3b1726d957ca779505c2c334342ac00faed1f8e5ced30b04fceda7fa733c0f",
                "md5": "45283cd51b90205b2bfeb7b89467acf9",
                "sha256": "ef5286f724bf1ba84256e297bbece0d60885649bd89351078fd393249ef0c840"
            },
            "downloads": -1,
            "filename": "meta_nbextension-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45283cd51b90205b2bfeb7b89467acf9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4152,
            "upload_time": "2024-04-07T04:37:22",
            "upload_time_iso_8601": "2024-04-07T04:37:22.421542Z",
            "url": "https://files.pythonhosted.org/packages/1e/3b/1726d957ca779505c2c334342ac00faed1f8e5ced30b04fceda7fa733c0f/meta_nbextension-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c8c38da16a77073a3b4d14ad3f9155cf8cfa43d706ceae819424d43f66cf579",
                "md5": "5cc4e6ac52794b80cfb26e044ae149cc",
                "sha256": "5fa4ccb653c3e5c829c78114cdf1e5a94337f1f3ce1863edc9b45493d798d1ed"
            },
            "downloads": -1,
            "filename": "meta-nbextension-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5cc4e6ac52794b80cfb26e044ae149cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3060,
            "upload_time": "2024-04-07T04:37:24",
            "upload_time_iso_8601": "2024-04-07T04:37:24.309697Z",
            "url": "https://files.pythonhosted.org/packages/0c/8c/38da16a77073a3b4d14ad3f9155cf8cfa43d706ceae819424d43f66cf579/meta-nbextension-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-07 04:37:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "answerdotai",
    "github_project": "meta-nbextension",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "meta-nbextension"
}
        
Elapsed time: 0.60175s