Spring Config Client Python
raw JSON → 0.1.3 verified Sat May 09 auth: no python
Lightweight Spring Cloud Config client for Python, version 0.1.3, released April 2025. Fetches configuration from Spring Cloud Config Server and supports property sources merging. Active development with monthly releases.
pip install spring-config-client-python Common errors
error AttributeError: module 'spring_config_client' has no attribute 'SpringConfigClient' ↓
cause Trying to import from wrong module path or old version installed.
fix
Install latest version (pip install --upgrade spring-config-client-python) and use 'from spring_config_client import SpringConfigClient'
error TypeError: __init__() got an unexpected keyword argument 'app' ↓
cause Using deprecated argument name 'app' which was changed to 'name' in v0.1.1.
fix
Replace 'app' with 'name' in constructor call.
error requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8888): Max retries exceeded ↓
cause Spring Cloud Config Server not running or URI incorrect.
fix
Set SPRING_CONFIG_URI environment variable to correct server URL, ensure server is running.
error KeyError: 'propertySources' ↓
cause Server response format is unexpected or empty; possibly wrong application name or profile.
fix
Verify server endpoints return valid JSON with propertySources array.
Warnings
breaking Constructor parameter name changed from 'app' (v0.1.0) to 'name' (v0.1.1+). Must update all code using 'app='. ↓
fix Replace SpringConfigClient(app=...) with SpringConfigClient(name=...)
deprecated Method get_config() may be renamed to fetch_config() in future v0.2.0. Check deprecation warnings in logs. ↓
fix Use get_config() for now, but prepare to use fetch_config() in the future.
gotcha If profiles argument is omitted, the client uses 'default' profile. Spring Cloud Config Server may require comma-separated list; ensure profiles string has no spaces around commas. ↓
fix Use profiles='dev,staging' (no spaces).
Imports
- SpringConfigClient wrong
from spring_config_client.client import SpringConfigClientcorrectfrom spring_config_client import SpringConfigClient
Quickstart
import os
from spring_config_client import SpringConfigClient
client = SpringConfigClient(
uri=os.environ.get('SPRING_CONFIG_URI', 'http://localhost:8888'),
name='myapp',
profiles=os.environ.get('SPRING_CONFIG_PROFILE', 'default')
)
config = client.get_config()
print(config)