{ "info": { "author": "PaddyAlton", "author_email": "paddy.alton@apolitical.co", "bugtrack_url": null, "classifiers": [], "description": "colab-env\n=========\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nOutline\n-------\n\nThis Python package handles environment variables in [Google Colab](https://research.google.com/colaboratory/faq.html). Environment variables are an important infrastructure component e.g. containing secrets such as API keys that ought not to be included directly in the codebase. At the time of writing, however, Google Colab does not have built-in support for environment variables.\n\nOur solution is to use the [python-dotenv](https://pypi.org/project/python-dotenv/) package in concert with Colab's built in authorisation tool for Google Drive. The package will attempt to\n\n1. mount Google Drive locally\n2. load environment variables from a file called `vars.env`\n\nUsage\n-----\n\nTo load environment variables using `colab-env` you should include the following code at the top of your Colab notebook:\n\n```\n!pip install colab-env -qU\nimport colab_env\n```\n\nThis will usually open the `google.colab.drive.mount` authentication flow. We use this authentication step to protect any secrets in `vars.env`.\n\n**Remember not to expose these secrets in the outputs of any cells!**\n\nWhen the authentication challenge is passed, the environment variables will either be loaded into the Google Colab environment, or `vars.env` will be created in your Google Drive.\n\nTo modify environment variables using `colab-env` you should do the following:\n\n```\n!pip install colab-env -qU\nfrom colab_env import envvar_handler\n```\n\n... and then use `envvar_handler`'s `add_env` and `del_env` methods to add/modify and delete environment variables respectively from `vars.env`.\n\nTake it for a test-drive\n------------------------\n\nSimply open up `colab-env/colab_env_testbed.ipynb` in Google Colab and try it out!\n\nContributors\n------------\n\nPaddy Alton (paddy.alton@apolitical.co)\n\n(with thanks to the [Apolitical](https://apolitical.co) engineering team for assistance and review)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/apolitical/colab-env/archive/v0.2.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "colab-env", "package_url": "https://pypi.org/project/colab-env/", "platform": "", "project_url": "https://pypi.org/project/colab-env/", "project_urls": { "Download": "https://github.com/apolitical/colab-env/archive/v0.2.0.tar.gz" }, "release_url": "https://pypi.org/project/colab-env/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Handles environment variables in Google Colab notebooks", "version": "0.2.0" }, "last_serial": 5492345, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "18347b360b47d16b5488343b047c4f62", "sha256": "f65ba5a41ee091c710afea7f616864611250928609f02fd3d4b0a9a3a2a2c397" }, "downloads": -1, "filename": "colab-env-0.0.1.tar.gz", "has_sig": false, "md5_digest": "18347b360b47d16b5488343b047c4f62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4446, "upload_time": "2019-07-05T15:20:18", "url": "https://files.pythonhosted.org/packages/df/49/684ca0c0aa37944e78be9e02ec347114f645f9941ecf3f293485af1f3d40/colab-env-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "102eb24f4fd6dc4a2b62e1b69d0da1b9", "sha256": "ebf0f204727e89ecbb2c30c13b9009e7e1ca59600081d7e645f5eaacbf39a350" }, "downloads": -1, "filename": "colab-env-0.0.2.tar.gz", "has_sig": false, "md5_digest": "102eb24f4fd6dc4a2b62e1b69d0da1b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4458, "upload_time": "2019-07-05T15:24:38", "url": "https://files.pythonhosted.org/packages/9f/58/ae37feba236f3728d2d9deb3524edda64ca5ebd1bf26738e955fdbe96aaf/colab-env-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "30faf59763c09c624d0fbaf99fb2b207", "sha256": "de23bbb7226db9466b72bef92f68e185d38e6958ab9b979cf95071a10a42479d" }, "downloads": -1, "filename": "colab-env-0.0.3.tar.gz", "has_sig": false, "md5_digest": "30faf59763c09c624d0fbaf99fb2b207", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4493, "upload_time": "2019-07-05T15:49:45", "url": "https://files.pythonhosted.org/packages/1d/1d/3b8433b5ab46a58a035942f5b76353670ea0911e2589a6bead35c6417f89/colab-env-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e2a39399a05b5349c679818e1d0dbccc", "sha256": "3ad949981b59717ae7433cf3645c6d3d7d7bb14a344c4b3ce5f6bae241c6e36a" }, "downloads": -1, "filename": "colab-env-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e2a39399a05b5349c679818e1d0dbccc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4503, "upload_time": "2019-07-05T16:19:29", "url": "https://files.pythonhosted.org/packages/2b/cf/d3fe81879b985b84826a80ee780278580332aae44de4094a1dfcbcf25a33/colab-env-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f70ab8d905bf93582018523503d0834b", "sha256": "7d25b504f53337893aa4c1bdf9f543a53ad1100de3c5d6179b8c784249107609" }, "downloads": -1, "filename": "colab-env-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f70ab8d905bf93582018523503d0834b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4523, "upload_time": "2019-07-05T16:32:08", "url": "https://files.pythonhosted.org/packages/1c/24/45bc5218ec7bb83da8110dc94a27d925239e2d33f8a0dcc1c8d1dd07eb30/colab-env-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f9dc7585c8117c7f622f62399cc6b9f1", "sha256": "3ab830d132f218ec1413621e1f8d5c0d40f590694d1b2b78002730945c3a9494" }, "downloads": -1, "filename": "colab-env-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f9dc7585c8117c7f622f62399cc6b9f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4527, "upload_time": "2019-07-05T16:55:33", "url": "https://files.pythonhosted.org/packages/0e/d8/8ee680c5119f81dea0f490377fc7733dc146a191a111aa3d192d065a4cba/colab-env-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5ae1a56c589214b2452737e71836e8b7", "sha256": "7995146cc5cd66a96aa07a2fce7178f0af45073787bc56f25e3e4480d7e506b7" }, "downloads": -1, "filename": "colab-env-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5ae1a56c589214b2452737e71836e8b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4685, "upload_time": "2019-07-05T17:08:15", "url": "https://files.pythonhosted.org/packages/9d/66/1845bc28d685894e6e203cfb2bdd9d19c86926d7a6f765e9497e218ab304/colab-env-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5ae1a56c589214b2452737e71836e8b7", "sha256": "7995146cc5cd66a96aa07a2fce7178f0af45073787bc56f25e3e4480d7e506b7" }, "downloads": -1, "filename": "colab-env-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5ae1a56c589214b2452737e71836e8b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4685, "upload_time": "2019-07-05T17:08:15", "url": "https://files.pythonhosted.org/packages/9d/66/1845bc28d685894e6e203cfb2bdd9d19c86926d7a6f765e9497e218ab304/colab-env-0.2.0.tar.gz" } ] }