No project description provided
Project description
environ_secretmanager
The environ_secretmanager
module is designed to be used to download Google Cloud Secrets Manager secrets and set them
as environment variables. This is useful for using secrets in various environments, and works especially well with App
Engine and Cloud Functions where the correct environment variables can be created in an env file during CI/CD and used
in the final build files for production.
Usage
from environ_secretmanager.env_secrets import EnvironSecretManager
secrets = EnvironSecretManager(GOOGLE_CLOUD_PROJECT_ID="my-project-id")
# To create a .env file with the secrets
secrets.create_dot_env_file()
# To use the secrets in the current environment
MY_SECRET = secrets.get_env_secret("MY_SECRET", 1)
Build For Local Distribution
Build the files then extract the setup.py file from the tarball and run it to install the package locally.
poetry build --format sdist
tar -xvf dist/*-`poetry version -s`.tar.gz -O '*/setup.py' > setup.py
Then on the machine you want to install the package on, run
pip install -e .
Development
This project uses Poetry in development to create a virtual environment and manage dependencies. To install poetry, run
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
Then, from the same directory as pyproject.toml
, run
poetry install
Run poetry
commands from this same directory to manage your development environment and/or setup the virtual environment created in the last step in your IDE.
See Poetry Docs for more info.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file environ_secretmanager-0.1.0.tar.gz
.
File metadata
- Download URL: environ_secretmanager-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bccee7c938d98945c46d937541bbe6f8c70cf5a59e2f039106e1f83f0aa7b371 |
|
MD5 | fe3be9beaedd292371b983dde14535c7 |
|
BLAKE2b-256 | 99e31514cf271249c2c4590077f2ca2a92f2bcd7658c4419ab711021c973ee3c |
File details
Details for the file environ_secretmanager-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: environ_secretmanager-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef7ba7537a2babca94c236dd5497f7ecfdf7fde966f85d704d8554ca025e3880 |
|
MD5 | 399e3fe5b74e59d2ced994991fb940a7 |
|
BLAKE2b-256 | d90adc417fc1cf746249f0f4471894b9a5e65746d46c2ede03dc453b2bbc3e46 |