Skip to main content
https://travis-ci.org/maroux/berglas-python.svg?branch=master https://coveralls.io/repos/github/maroux/berglas-python/badge.svg?branch=master https://img.shields.io/pypi/v/berglas.svg?style=flat-square https://img.shields.io/pypi/pyversions/berglas.svg?style=flat-square https://img.shields.io/pypi/implementation/berglas.svg?style=flat-square https://img.shields.io/badge/code%20style-black-000000.svg

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 berglas.auto  # 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()
    client.replace("MY_SECRET")
    print(os.environ["MY_SECRET"])

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

Release Notes

v0.1

  • First version

Development

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 https://github.com/maroux/berglas-python.git
$ cd python
$ pyenv virtualenv 3.9.14 berglas-3.9
...
$ pyenv shell berglas-3.9
$ pip install setuptools==58
$ pip install -r requirements/dev-3.9.txt

Updating Requirements Files

Update the install_requires variable in setup.py and then from the pyenv virtualenv shell run: .. code:: sh

$ python -m pip install pip==18.0 pip-tools==3.2.0 –upgrade $ make pip_compile

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

Metadata

Release files for berglas 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for berglas 0.3.1
File Size Uploaded Provenance
berglas-0.3.1.tar.gz 11.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for berglas 0.3.1
File Interpreter ABI Platform
berglas-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / berglas-0.3.1.tar.gz

Download URL berglas-0.3.1.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3862025b6182e820102333529fb039b809f27f4fe31fa7c13668265dbd077b71
BLAKE2b-256 checksum
How to use checksums
77a11326a7d9550405c9a4b76aa6081cfe27644db4523ac40187de6e52c986e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / berglas-0.3.1-py3-none-any.whl

Download URL berglas-0.3.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d44cbf76c8fcb214db51b2045b0e883384ab1b1a6710389a6657476ea609effe
BLAKE2b-256 checksum
How to use checksums
b211096c9df7fc59e357e9797e4a5e43fc8e7acf9c8060823d93a45713296d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Security for berglas 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page