# 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:
```bash
pip install pyremoteenv
```
The only supported backend is ZooKeeper. Install dependencies for it
```bash
pip install pyremoteenv[zk]
```
---
## Requirements
- Python 3.9+
- [kazoo](https://kazoo.readthedocs.io/en/latest/) - For ZooKeeper support.
---
## Usage
```python
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](https://github.com/Romamo/pyremoteenv/tree/main/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:
```bash
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](https://github.com/Romamo/pyremoteenv/blob/main/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](https://github.com/username/pyremoteenv/issues).
Happy coding! 🚀
Raw data
{
"_id": null,
"home_page": null,
"name": "pyremoteenv",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "zookeeper, config-management, remote, environment, kazoo",
"author": null,
"author_email": "Roman Medvedev <pypi@romavm.dev>",
"download_url": "https://files.pythonhosted.org/packages/71/35/6da3640e19385cb1423f63123c6f4c10add22026f1286a96b6330d15bb9f/pyremoteenv-0.2.5.tar.gz",
"platform": null,
"description": "# pyremoteenv\n\n---\n`pyremoteenv` is a Python package that allows you to configure your application with environment variables loaded from a remote registry.\n\nCurrently, the supported backend is ZooKeeper, but it's easy to extend to support other backends.\n\n---\n## Installation\n\nInstall `pyremoteenv` using pip:\n\n```bash\npip install pyremoteenv\n```\n\nThe only supported backend is ZooKeeper. Install dependencies for it \n```bash\npip install pyremoteenv[zk]\n```\n\n---\n\n## Requirements\n\n- Python 3.9+\n- [kazoo](https://kazoo.readthedocs.io/en/latest/) - For ZooKeeper support.\n\n---\n\n## Usage\n\n```python\nimport os\nimport remoteenv\n\nremote_env = remoteenv.Env('zk')\nwith remote_env:\n\n # Write to remote config\n remote_env.set('TEST', 'test')\n\n # Read from remote config and set environment variables\n remote_env.read_to_os()\n print(os.environ['TEST'])\n\n # Read from remote config and write to django-environ\n remote_env.read_to_file(file=buffer)\n environ.Env.read_env(buffer, overwrite=True)\n\n remote_env.delete('TEST')\n \n # Use znodes tree to find custom or default variable from remote config\n remote_env.get('DATABASE_HOST')\n remote_env.get('service_1/host_4/DATABASE_HOST')\n remote_env.read_to_os('service_1', 'service_1/host_4')\n```\n\nMore examples can be found in the [examples](https://github.com/Romamo/pyremoteenv/tree/main/examples).\n\n---\n\n## TODO\n\n- More backends: plain text, json, firebase\n- Watching mechanism to interact or inject new values immediately on change\n\n---\n\n## Contributing\n\nContributions are welcome! If you'd like to enhance the functionality or fix issues, kindly follow these steps:\n\n1. Fork the repository on GitHub.\n2. Clone your fork:\n ```bash\n git clone https://github.com/Romamo/pyremoteenv.git\n ```\n3. Make your changes and test them.\n4. Submit a pull request.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/Romamo/pyremoteenv/blob/main/LICENSE) file for more details.\n\n---\n\n## Support\n\nIf you encounter any issues or have questions, feel free to open an issue on the [GitHub Issues Page](https://github.com/username/pyremoteenv/issues).\n\nHappy coding! \ud83d\ude80\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Remote env for python",
"version": "0.2.5",
"project_urls": {
"Homepage": "https://github.com/Romamo/pyremoteenv"
},
"split_keywords": [
"zookeeper",
" config-management",
" remote",
" environment",
" kazoo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8ce6d81130e7cc72bb1d13069d7bf0120e8be4346fb9ea9dd237db9a254e175d",
"md5": "97139b868f4cc813c12bfd1d2d262744",
"sha256": "67b6a4c99ac1b303393a62e7a61fb9d5b29e0bb8e911b425a5ac84037d9a396c"
},
"downloads": -1,
"filename": "pyremoteenv-0.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "97139b868f4cc813c12bfd1d2d262744",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7992,
"upload_time": "2024-12-24T19:14:03",
"upload_time_iso_8601": "2024-12-24T19:14:03.258944Z",
"url": "https://files.pythonhosted.org/packages/8c/e6/d81130e7cc72bb1d13069d7bf0120e8be4346fb9ea9dd237db9a254e175d/pyremoteenv-0.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "71356da3640e19385cb1423f63123c6f4c10add22026f1286a96b6330d15bb9f",
"md5": "6d3e6887305e941d9c7cf2c0cfc5827d",
"sha256": "670ec3fe2d90b4d03924d794fae7bcb59fddcccd81b2ba44a60ec4098b6516ae"
},
"downloads": -1,
"filename": "pyremoteenv-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "6d3e6887305e941d9c7cf2c0cfc5827d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7182,
"upload_time": "2024-12-24T19:14:04",
"upload_time_iso_8601": "2024-12-24T19:14:04.343378Z",
"url": "https://files.pythonhosted.org/packages/71/35/6da3640e19385cb1423f63123c6f4c10add22026f1286a96b6330d15bb9f/pyremoteenv-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-24 19:14:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Romamo",
"github_project": "pyremoteenv",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyremoteenv"
}