Skip to main content

Live, database-backed environment variable manager for Python

Project description

EnvStream

GitHub release (latest by date) GitHub tag (latest by date) GitHub Workflow Status GitHub license GitHub issues

📌 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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature-branch)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature-branch)
  5. 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


Download files

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

Source Distribution

envstream-0.2.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envstream-0.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for envstream-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cc1d26a5f18e67887a8b3dfa321590bc05cef6ebca4e300f6e1a1c0e16574471
MD5 a463c6e440142e5fb208084b7f39218a
BLAKE2b-256 e5a751ba86acea0f078d39d72389cbfbc8d8f35ded5c6240fad2216094fdb4f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for envstream-0.2.0.tar.gz:

Publisher: python-publish.yml on mjsully/EnvStream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for envstream-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e179e7365605681f9f5fde8d564726d17f4dc79090e9ef766ee873b659289a9
MD5 ad129583a7ab65e36bb4e97604520f01
BLAKE2b-256 e61334f6aeb3cd37c9290691d1aa2bb38c9a8fd6a90f7e02aa9c736c30bf597b

See more details on using hashes here.

Provenance

The following attestation bundles were made for envstream-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on mjsully/EnvStream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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