Skip to main content

Berglas Python Library

Project description

This library automatically parses berglas references when imported.

Only Python 3.6+ is supported currently.

You can find the latest, most up to date, documentation on Github.

Quick Start

Install library:

pip install berglas

Import the module:

import  # noqa

When imported, the berglas module will:

1. Detect the runtime environment and call the appropriate API to get the list of environment variables that were set on the resource at deploy time

1. Download and decrypt any secrets that match the Berglas environment variable reference syntax

  1. Replace the value for the environment variable with the decrypted secret

You can also opt out of auto-parsing and call the library yourself instead:

import os

from berglas import resolver

if __name__ == '__main__':
    client = resolver.Client()

    // alternatively, use resolve method to simply get the value without updating environment:
    my_secret = client.resolve(os.environ["MY_SECRET"])

Release Notes


  • First version


Getting Started

Assuming that you have Python, pyenv and pyenv-virtualenv installed, set up your environment and install the required dependencies like this instead of the pip install berglas defined above:

$ git clone
$ cd python
$ pyenv virtualenv 3.7.2 berglas-3.7
$ pyenv shell berglas-3.7
$ pip install -r requirements/dev-3.7.txt

Running Tests

You can run tests in using make test. By default, it will run all of the unit and functional tests, but you can also specify your own py.test options.

$ py.test

Getting Help

We use GitHub issues for tracking bugs and feature requests.

  • If it turns out that you may have found a bug, please open an issue

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

berglas-0.1.0.tar.gz (6.9 kB view hashes)

Uploaded source

Built Distribution

berglas-0.1.0-py3-none-any.whl (11.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page