{ "info": { "author": "Benjamin Bertrand", "author_email": "beenje@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "# JupyterLab GitLab\n\nA JupyterLab extension for browsing GitLab repositories (in read-only mode).\n\nThis extension is based on [jupyterlab-github](https://github.com/jupyterlab/jupyterlab-github).\nAll credit to the JupyterLab team, and especially [Ian Rose](https://github.com/ian-r-rose), for the github extension!\n\nThanks as well to [Mark Ghiorso](https://gitlab.com/ghiorso) for the [jupyterlab_gitlab](https://gitlab.com/ENKI-portal/jupyterlab_gitlab)\nextension where I took some inspiration. It didn't fit my needs (no server extension) so I decided to create my own based on a recent\nversion of jupyterlab-github instead (v0.10.0).\n\n### What this extension is\n\nWhen you install this extension, an additional filebrowser tab will be added\nto the left area of JupyterLab. This filebrowser allows you to select GitLab\ngroups and users, browse their repositories, and open the files in those\nrepositories. If those files are notebooks, you can run them just as you would\nany other notebook. You can also attach a kernel to text files and run those.\nBasically, you should be able to open any file in a repository that JupyterLab can handle.\n\nWARNING! Subgroups are currently not supported.\n\nHere is a screenshot of the plugin opening this very file on GitLab:\n![gitception](gitception.png 'Gitception')\n\n### What this extension is not\n\nThis is not an extension that provides full GitLab access, such as\nsaving files, making commits, forking repositories, etc.\n\nIf you want to use git from JupyterLab, you should look at the\n[jupyterlab-git](https://github.com/jupyterlab/jupyterlab-git) extension.\n\n### Remarks\n\nThis extension has both a client-side component (that is, Javascript that is bundled\nwith JupyterLab), and a server-side component (that is, Python code that is added\nto the Jupyter notebook server). This extension _will_ work without the server extension,\nwith some drawbacks:\n\n- requests will be unauthenticated and only give access to public repositories\n- unauthenticated requests can impose rate-limits depending on your GitLab instance\n (meaning you might have to wait before regaining access)\n- only the 20 first results are returned (pagination links are not followed)\n\nFor those reasons, you should set up the server extension as well as the lab extension.\nThis process is described in the [installation](#Installation) section.\n\n## Prerequisites\n\n- JupyterLab 1.0\n- A GitLab account for the server extension\n\n## Installation\n\nAs discussed above, this extension has both a server extension and a lab extension.\nWe recommend installing both to allow authentication and pagination.\nThe purpose of the server extension is to add GitLab credentials that you will need to acquire\nfrom https://gitlab.com/profile/personal_access_tokens, and then to proxy your request to GitLab.\n\n### 1. Installing the lab extension\n\nTo install the lab extension, enter the following in your terminal:\n\n```bash\njupyter labextension install jupyterlab-gitlab\n```\n\nWith only this installed, the extension should work.\n\n### 2. Getting your credentials from GitLab\n\nYou need to create a personal access token to authenticate yourself to GitLab.\n\n1. Go to https://gitlab.com/profile/personal_access_tokens or from GitLab, go to your `Settings`_ > `Access Tokens`_.\n1. Under `Name`, enter a short description, to identify the purpose\n of this token. I recommend something like: `jupyterlab-gitlab`.\n1. Under Scopes, check the `api` scope.\n1. Click `Create personal access token`. You will see your new personal access token (a 21 characters string).\n Click on the copy to clipboard icon and and paste it locally in a text file for now.\n If you have a password manager like 1password, use that.\n\nThis is the only time you'll see this token in GitLab. If you lose it, you'll\nneed to create another one.\n\n### 3. Installing the server extension\n\nInstall the server extension using pip, and then enable it:\n\n```bash\npip install jupyterlab-gitlab\n```\n\nIf you are running Notebook 5.3 or later, this will automatically enable the extension.\nIf not, enable the server extension by running:\n\n```bash\njupyter serverextension enable --sys-prefix jupyterlab_gitlab\n```\n\nYou can check if the server extension is enabled by running:\n\n```bash\njupyter serverextension list\n```\n\nYou should now add the credentials you got from GitLab to your notebook configuration file.\nInstructions for generating a configuration file can be found\n[here](http://jupyter-notebook.readthedocs.io/en/stable/config_overview.html#configure-nbserver).\nOnce you have identified this file, add the following line to it:\n\n```python\nc.GitLabConfig.access_token = \"< YOUR_ACCESS_TOKEN >\"\n```\n\nwhere `< YOUR_ACCESS_TOKEN >` is the string value you obtained above.\n\n## Customization\n\n### Customizing the server extension\n\nYou saw how to add your `access_token` to the notebook configuration file.\nThere are other parameters than you can modify using that file.\nThose are the default values:\n\n```python\nc.GitLabConfig.allow_client_side_access_token = False\nc.GitLabConfig.url = \"https://gitlab.com\"\nc.GitLabConfig.validate_cert = True\n```\n\nIf you run your own GitLab instance for example, update `c.GitLabConfig.url` to point to it.\n\n### Customizing the lab extension\n\nYou can set the plugin to start showing a particular repository at launch time.\nOpen the \"Advanced Settings\" editor in the JupyterLab Settings menu,\nand under the GitLab settings add\n\n```json\n{\n \"baseUrl\": \"https://gitlab.com\",\n \"defaultRepo\": \"owner/repository\"\n}\n```\n\nwhere `owner` is the GitLab user or group,\nand `repository` is the name of the repository you want to open.\n\nThe `baseUrl` can also be updated to point to your own GitLab instance.\nIf you use the server extension, this url is only used for the `Open this repository on GitLab` button.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/beenje/jupyterlab-gitlab", "keywords": "Jupyter,JupyterLab,GitLab", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "jupyterlab-gitlab", "package_url": "https://pypi.org/project/jupyterlab-gitlab/", "platform": "Linux", "project_url": "https://pypi.org/project/jupyterlab-gitlab/", "project_urls": { "Homepage": "https://gitlab.com/beenje/jupyterlab-gitlab" }, "release_url": "https://pypi.org/project/jupyterlab-gitlab/0.2.0/", "requires_dist": [ "notebook" ], "requires_python": ">=3.5", "summary": "A Jupyter Notebook server extension which acts as a proxy for the GitLab API.", "version": "0.2.0" }, "last_serial": 5507440, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "08341b2b5d0f587fe96a91d36e5e484e", "sha256": "4b5f8c2d6e25ba7753b579782e9f1b8e061a7b6edd914fd9e6a01052606870b1" }, "downloads": -1, "filename": "jupyterlab_gitlab-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "08341b2b5d0f587fe96a91d36e5e484e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7330, "upload_time": "2018-12-12T20:12:38", "url": "https://files.pythonhosted.org/packages/f4/d6/1753851d56335de5538f2587d8beaafb1e7ba4f9c3430c307efc81debf77/jupyterlab_gitlab-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b017676cc464ead88f75a0407776d7dd", "sha256": "f1a9dca3a67124e12cfd8152ba6e77eeb99e13a8d071ba7d5a15d81ef45f1aac" }, "downloads": -1, "filename": "jupyterlab-gitlab-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b017676cc464ead88f75a0407776d7dd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7094, "upload_time": "2018-12-12T20:12:41", "url": "https://files.pythonhosted.org/packages/7f/2c/de3581dded73382a85cf700ca28d0a1aee677f3286a45e98ae001915ce13/jupyterlab-gitlab-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f6d6aafbafb0a67ecd5ea5db61b0db8d", "sha256": "b58aabd10fcce66accb21c2ac2eeccd371f2b47c0833dddc10f9a585138b3585" }, "downloads": -1, "filename": "jupyterlab_gitlab-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f6d6aafbafb0a67ecd5ea5db61b0db8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7419, "upload_time": "2019-07-09T14:26:28", "url": "https://files.pythonhosted.org/packages/ab/09/7183fdeea7f5c0c165175bc426ab81108dd08d17a26e02c4fbc80052a8a5/jupyterlab_gitlab-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "659b251ad05832992aaafed145e2873f", "sha256": "580626104d2e0754ecbc1334f197a567076cd5d097a6513a7550cf897ced50af" }, "downloads": -1, "filename": "jupyterlab-gitlab-0.2.0.tar.gz", "has_sig": false, "md5_digest": "659b251ad05832992aaafed145e2873f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7129, "upload_time": "2019-07-09T14:26:29", "url": "https://files.pythonhosted.org/packages/d2/7b/211047ef8f991e53ac2542fe14d8670208bd0c7f580a1b1e5ad7d9a7b81b/jupyterlab-gitlab-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6d6aafbafb0a67ecd5ea5db61b0db8d", "sha256": "b58aabd10fcce66accb21c2ac2eeccd371f2b47c0833dddc10f9a585138b3585" }, "downloads": -1, "filename": "jupyterlab_gitlab-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f6d6aafbafb0a67ecd5ea5db61b0db8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7419, "upload_time": "2019-07-09T14:26:28", "url": "https://files.pythonhosted.org/packages/ab/09/7183fdeea7f5c0c165175bc426ab81108dd08d17a26e02c4fbc80052a8a5/jupyterlab_gitlab-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "659b251ad05832992aaafed145e2873f", "sha256": "580626104d2e0754ecbc1334f197a567076cd5d097a6513a7550cf897ced50af" }, "downloads": -1, "filename": "jupyterlab-gitlab-0.2.0.tar.gz", "has_sig": false, "md5_digest": "659b251ad05832992aaafed145e2873f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7129, "upload_time": "2019-07-09T14:26:29", "url": "https://files.pythonhosted.org/packages/d2/7b/211047ef8f991e53ac2542fe14d8670208bd0c7f580a1b1e5ad7d9a7b81b/jupyterlab-gitlab-0.2.0.tar.gz" } ] }