Skip to main content

pyremoteenv


pyremoteenv is a Python package that allows you to configure your application with environment variables loaded from a remote registry.

Currently, the supported backend is ZooKeeper, but it's easy to extend to support other backends.


Installation

Install pyremoteenv using pip:

pip install pyremoteenv

The only supported backend is ZooKeeper. Install dependencies for it

pip install pyremoteenv[zk]

Requirements

  • Python 3.9+
  • kazoo - For ZooKeeper support.

Usage

import os
import remoteenv

remote_env = remoteenv.Env('zk')
with remote_env:

     # Write to remote config
     remote_env.set('TEST', 'test')

     # Read from remote config and set environment variables
     remote_env.read_to_os()
     print(os.environ['TEST'])

     # Read from remote config and write to django-environ
     remote_env.read_to_file(file=buffer)
     environ.Env.read_env(buffer, overwrite=True)

     remote_env.delete('TEST')
     
     # Use znodes tree to find custom or default variable from remote config
     remote_env.get('DATABASE_HOST')
     remote_env.get('service_1/host_4/DATABASE_HOST')
     remote_env.read_to_os('service_1', 'service_1/host_4')

More examples can be found in the examples.


TODO

  • More backends: plain text, json, firebase
  • Watching mechanism to interact or inject new values immediately on change

Contributing

Contributions are welcome! If you'd like to enhance the functionality or fix issues, kindly follow these steps:

  1. Fork the repository on GitHub.
  2. Clone your fork:
    git clone https://github.com/Romamo/pyremoteenv.git
    
  3. Make your changes and test them.
  4. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


Support

If you encounter any issues or have questions, feel free to open an issue on the GitHub Issues Page.

Happy coding! 🚀

Metadata

Release files for pyremoteenv 0.2.5

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

Source distribution (sdist)

Source distribution for pyremoteenv 0.2.5
File Size Uploaded Provenance Actions
pyremoteenv-0.2.5.tar.gz 7.2 kB Without provenance Details for pyremoteenv-0.2.5.tar.gz

Built distribution (wheel)

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

Total release size: 15.2 kB

Release files / pyremoteenv-0.2.5.tar.gz

Download URL pyremoteenv-0.2.5.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
670ec3fe2d90b4d03924d794fae7bcb59fddcccd81b2ba44a60ec4098b6516ae
BLAKE2b-256 checksum
How to use checksums
71356da3640e19385cb1423f63123c6f4c10add22026f1286a96b6330d15bb9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.13

Release files / pyremoteenv-0.2.5-py3-none-any.whl

Download URL pyremoteenv-0.2.5-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67b6a4c99ac1b303393a62e7a61fb9d5b29e0bb8e911b425a5ac84037d9a396c
BLAKE2b-256 checksum
How to use checksums
8ce6d81130e7cc72bb1d13069d7bf0120e8be4346fb9ea9dd237db9a254e175d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.13

Security for pyremoteenv 0.2.5

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