Live, database-backed environment variable manager for Python
Project description
EnvStream
📌 Overview
This project provides a database-backed, environmental variables store, enabling on-the-fly app reconfigurations without redeployment!
🚀 Features
- Add, update and remove environment variables from code, or from the DB!
- Inferred variable typing
📦 Installation
Install the package using pip:
pip install envstream
🛠 Usage
Here is an example of using EnvStream:
from envstream import EnvStream
# Create instance of EnvStream
var_handler = EnvStream(
"Application Name",
log_level="DEBUG"
)
# Setup DB credentials
var_handler.setup_db(
username="username",
password="password",
host="host",
port="5432",
database="database"
)
# Loads variables from DB (WHERE application = 'Application Name')
var_handler.get_variables()
# Set some variables of different types
var_handler.set_variable("variable1", "value")
var_handler.set_variable("variable2", 1)
var_handler.set_variable("variable3", 1.0)
var_handler.set_variable("variable4", True)
# Update variable by name
var_handler.set_variable("variable4", False)
# Delete variable by name
var_handler.remove_variable("variable4")
# Periodically refresh variables
while True:
var_handler.refresh()
time.sleep(5)
# Automatically refresh variables
var_handler.auto_refresh(frequency=5)
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature-branch) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature-branch) - Open a Pull Request
📜 License
This project is licensed under the MIT License.
📬 Contact
If you have any questions, feel free to open an issue or reach out via email at mattys940@gmail.com.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file envstream-0.2.0.tar.gz.
File metadata
- Download URL: envstream-0.2.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc1d26a5f18e67887a8b3dfa321590bc05cef6ebca4e300f6e1a1c0e16574471
|
|
| MD5 |
a463c6e440142e5fb208084b7f39218a
|
|
| BLAKE2b-256 |
e5a751ba86acea0f078d39d72389cbfbc8d8f35ded5c6240fad2216094fdb4f3
|
Provenance
The following attestation bundles were made for envstream-0.2.0.tar.gz:
Publisher:
python-publish.yml on mjsully/EnvStream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envstream-0.2.0.tar.gz -
Subject digest:
cc1d26a5f18e67887a8b3dfa321590bc05cef6ebca4e300f6e1a1c0e16574471 - Sigstore transparency entry: 261340746
- Sigstore integration time:
-
Permalink:
mjsully/EnvStream@5bd53034bcb050b4e15bbd6c01fd1023c5575728 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/mjsully
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5bd53034bcb050b4e15bbd6c01fd1023c5575728 -
Trigger Event:
release
-
Statement type:
File details
Details for the file envstream-0.2.0-py3-none-any.whl.
File metadata
- Download URL: envstream-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e179e7365605681f9f5fde8d564726d17f4dc79090e9ef766ee873b659289a9
|
|
| MD5 |
ad129583a7ab65e36bb4e97604520f01
|
|
| BLAKE2b-256 |
e61334f6aeb3cd37c9290691d1aa2bb38c9a8fd6a90f7e02aa9c736c30bf597b
|
Provenance
The following attestation bundles were made for envstream-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on mjsully/EnvStream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envstream-0.2.0-py3-none-any.whl -
Subject digest:
7e179e7365605681f9f5fde8d564726d17f4dc79090e9ef766ee873b659289a9 - Sigstore transparency entry: 261340753
- Sigstore integration time:
-
Permalink:
mjsully/EnvStream@5bd53034bcb050b4e15bbd6c01fd1023c5575728 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/mjsully
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5bd53034bcb050b4e15bbd6c01fd1023c5575728 -
Trigger Event:
release
-
Statement type: