Skip to main content

This package provides functions for using secrets in a Jupyter notebook.

Project description

Latest PyPI Version Documentation Status License Supported Python Versions

IPython Secrets makes it easier to use secrets in a Jupyter notebook.

The first time get_secret is called, it prompts the user for the password or other secret. After this value is read, it is saved in the system keyring, and the Jupyter output cell is then cleared.


Subsequent calls to get_secret use the saved value. This is true even if they are called in a different process running in the same account – for example, if the machine has been rebooted, or the local Jupyter server has otherwise been shut down and restarted.



pip3 install ipython-secrets


from ipython_secrets import *



Secrets can also be stored in an environment variable, and read from the notebook. This is a best practice for applications (and especially web and other server-side services), but I’ve found it inconvenient for notebooks – the notebook server must be re-started to pick up a new environment variable; and, it complicates the setup instructions for notebook users.


Install Pipenv, and required packages:

$ pip3 install pipenv
$ pipenv install
$ pipenv shell
$ pip install flit

Install locally:

flit install --symlink


This package is a thin wrapper around Keyring.



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipython-secrets-1.1.1.tar.gz (70.2 kB view hashes)

Uploaded Source

Built Distribution

ipython_secrets-1.1.1-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page