Streamline configuration management by fetching and updating configurations from a Spring Cloud Config Server in Python.
Project description
config-server-client-python
Streamline configuration management by fetching and updating configurations from a Spring Cloud Config Server in Python.
Overview
config-server-client-python
is a client library designed to interact with the Spring Cloud Config Server, facilitating seamless integration of configuration properties into your Python applications. This package is particularly useful for applications built using frameworks such as Django and Flask.
Features
- Fetch configurations from a Spring Cloud Config Server.
- Update configurations as environment variables within the container.
- Easy integration with Python frameworks like Django and Flask.
- Simplified configuration management for microservices architecture.
Installation
Add config-server-client-python
to your requirements.txt
file:
config-server-client-python==<version_no>
Usage
Django/Flask Integration
In your manage.py
or equivalent entry point, import the ConfigServerPythonClient
:
from src.config_server_python_library import ConfigServerPythonClient
client = ConfigServerPythonClient(
os.getenv('CONFIG_SERVER_URL'),
<service-name>,
<profile-list>,
os.getenv('COMMIT_ID'),
os.getenv('ENV_NAMESPACE')
)
client.write_configs_to_env()
This will retrieve the configurations from the Spring Cloud Config Server and set them as environment variables for your application.
Development and Deployment
Pushing a New Version to Nexus
1} Clone config-server-client-python repo.
git clone https://github.com/jayantreddy181198/config-server-client-python.git <destination_path>/tm-config-server-client-python
2} Install twine and setuptools from pypi if not exists already.
pip install twine setuptools
3} RUN below command to create sdist.
python setup.py sdist bdist_wheel
4} Upload package to nexus.
twine upload dist/*
```%
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 config_server_client_python-1.0.2.tar.gz
.
File metadata
- Download URL: config_server_client_python-1.0.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b79cf497c6f3797e58881c6263a924fff0a6831d95dc4addbf26974be33c0c3 |
|
MD5 | a6d58ad92046f5d972c4d82329d600ac |
|
BLAKE2b-256 | 6f21f584f70242914a78756e9747c0e571700c162a61aab726b3497af820a614 |
File details
Details for the file config_server_client_python-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: config_server_client_python-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ded6eb838c5c9a2235029762c56a692527067d6e03ae87193f817fd04803c3f4 |
|
MD5 | ab6907cb990743ef7e5df6ee799f9f9d |
|
BLAKE2b-256 | f141bac5cb275a7f073de95df7b9ae67ac7f8afd011cc7e6a2b19bcec05b3dbf |