{"id":14977173,"url":"https://github.com/osteele/ipython-secrets","last_synced_at":"2025-11-07T23:32:12.509Z","repository":{"id":50179639,"uuid":"118468341","full_name":"osteele/ipython-secrets","owner":"osteele","description":"A Python package that simplifies the use of secrets in a Jupyter notebook","archived":false,"fork":false,"pushed_at":"2021-10-21T18:34:53.000Z","size":175,"stargazers_count":21,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-28T23:40:55.983Z","etag":null,"topics":["ipython","ipython-notebook","jupyter","jupyter-notebook-extension","keyring","password-store","python-package"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osteele.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-22T14:30:45.000Z","updated_at":"2024-04-17T19:58:12.000Z","dependencies_parsed_at":"2022-08-30T15:41:15.206Z","dependency_job_id":null,"html_url":"https://github.com/osteele/ipython-secrets","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fipython-secrets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fipython-secrets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fipython-secrets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fipython-secrets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osteele","download_url":"https://codeload.github.com/osteele/ipython-secrets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219860225,"owners_count":16556023,"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":["ipython","ipython-notebook","jupyter","jupyter-notebook-extension","keyring","password-store","python-package"],"created_at":"2024-09-24T13:55:14.516Z","updated_at":"2025-10-28T02:31:07.084Z","avatar_url":"https://github.com/osteele.png","language":"Python","readme":"IPython Secrets\n===============\n\n|PyPI version| |Doc Status| |License| |Supported Python|\n\n**IPython Secrets** makes it easier to use secrets in a Jupyter notebook.\n\nThe first time `get_secret` is called, it prompts the user for the password or\nother secret. After this value is read, it is saved in the system keyring, and\nthe Jupyter output cell is then cleared.\n\n|gif1|\n\nSubsequent calls to ``get_secret`` use the saved value. This is true even\nif they are called in a different process running in the same account -- for\nexample, if the machine has been rebooted, or the local Jupyter server has\notherwise been shut down and restarted.\n\n|gif2|\n\n.. note:: Install the `gsheet-keyring package`_ to use ipython-secrets on\n    `Google Colaboratory`_: ``pip3 install gsheet-keyring``. The gsheet-keyring\n    package provides a Keyring backend that is backed by Google Sheets. This is\n    necessary since the Colaboratory environment doesn't provide a persistent\n    file system, or the OS services that the Keyring's standard and alternative\n    backends rely on.\n\n.. warning:: This package stores the secret on the Jupyter server. Don't trust\n    it with secrets you don't trust the Jupyter server with. (This is true for\n    all means of using a secret in a notebook.)\n\n.. warning:: The package is intended to reduce the likelihood of accidental\n    disclosure of secrets in notebook source. It won't secure a secret from code\n    that is running *in* the notebook; and it won't keep you from writing code\n    that displays the secret in a notebook output cell -- in which case it has\n    been disclosed to whoever can see the notebook.\n\nInstall\n-------\n\n.. code:: bash\n\n        pip3 install ipython-secrets\n\nUsage\n-----\n\n.. code:: python\n\n        from ipython_secrets import *\n\n        TWILIO_API_KEY = get_secret('TWILIO_API_KEY')\n\nAlternatives\n------------\n\nSecrets can also be stored in an environment variable, and read from the\nnotebook. This is a best practice for applications (and especially web and other\n`server-side services`_), but I've found it inconvenient for notebooks -- the\nnotebook server must be re-started to pick up a new environment variable; and,\nit complicates the setup instructions for notebook users.\n\nDevelopment\n-----------\n\nInstall Pipenv, and required packages:\n\n.. code:: bash\n\n    $ pip3 install pipenv\n    $ pipenv install\n    $ pipenv shell\n    $ pip install flit\n\nInstall locally:\n\n.. code:: bash\n\n    flit install --symlink\n\nAcknowledgements\n----------------\n\nThis package is a thin wrapper around Keyring_.\n\nLicense\n-------\n\nMIT\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/ipython-secrets.svg\n    :target: https://pypi.python.org/pypi/ipython-secrets\n    :alt: Latest PyPI Version\n.. |Doc Status| image:: https://readthedocs.org/projects/ipython-secrets/badge/?version=latest\n    :target: http://ipython-secrets.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n.. |License| image:: https://img.shields.io/pypi/l/ipython-secrets.svg\n    :target: https://pypi.python.org/pypi/ipython-secrets\n    :alt: License\n.. |Supported Python| image:: https://img.shields.io/pypi/pyversions/ipython-secrets.svg\n    :target: https://pypi.python.org/pypi/ipython-secrets\n    :alt: Supported Python Versions\n\n.. _API documentation: http://ipython-secrets.readthedocs.io/en/latest/?badge=latest#module-ipython_secrets\n\n.. |gif1| image:: ./docs/images/first-time.gif\n.. |gif2| image:: ./docs/images/next-time.gif\n\n.. _Google Colaboratory: https://colab.research.google.com/\n.. _Hydrogen: https://nteract.io/atom\n.. _Keyring: https://pypi.python.org/pypi/keyring\n.. _Nteract: https://nteract.io\n.. _server-side services: https://12factor.net/\n.. _gsheet-keyring package: https://pypi.org/project/gsheet-keyring/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosteele%2Fipython-secrets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosteele%2Fipython-secrets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosteele%2Fipython-secrets/lists"}