spring-config-client
A Python client for Spring Config Server.
This library is inspired by amenezes/config-client and is essentially a toned-down fork that I customized to fit my own needs.
Project goals
- Provide a basic client
- Provide basic authentication
- Add support for CloudFoundry
Installation
Install using pip
$ pip install spring-config-client
Usage
The very basic usage of this library looks like this:
from spring_config import ClientConfigurationBuilder
from spring_config.client import SpringConfigClient
config = ClientConfigurationBuilder().app_name("test-application").build()
c = SpringConfigClient(config)
c.get_config()
By default, ClientConfigurationBuilder builds a ClientConfiguration object with server address and application profile set to http://localhost:8888 and development. These can be changed like this:
Here are some examples:
# Fetch from http://someserver.com using profile "development"
config = (
ClientConfigurationBuilder()
.app_name("test-application")
.address("http://someserver.com")
.build()
)
# Fetch from http://someserver.com using profile "production"
config = (
ClientConfigurationBuilder()
.app_name("test-application")
.address("http://someserver.com")
.profile("production")
.build()
)
Authentication
If your configuration server requires to use basic authentication, you can create the client configuration like this:
from spring_config import ClientConfigurationBuilder
config = (
ClientConfigurationBuilder()
.app_name("test-application")
.authentication(("username", "password"))
.build()
)
Configuration options
The ClientConfigurationBuilder allow controlling these parameters.
- Application Name :
app_name("some-app")- DefaultNone, required. - Server Address :
address("http://some-server")- Defaulthttp://localhost:8888, optional. - Profile :
profile("production")- Defaultdevelopment, optional. - Branch :
branch("devel/0.1")- Defaultmaster, optional.
Requesting features
Please use the issues section to request new features and I will try to take out my time to work on them. Contributions in any sorts are always welcome :)
Metadata
Release files for spring-config-client 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spring-config-client-1.0.0.linux-x86_64.tar.gz | 7.3 kB | Without provenance | Details for spring-config-client-1.0.0.linux-x86_64.tar.gz |
Release files / spring-config-client-1.0.0.linux-x86_64.tar.gz
| Download URL | spring-config-client-1.0.0.linux-x86_64.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b616c9c7e479b4b5112a24ee2af89708653bb9093601b8550b5d64242c7afe2
|
|
BLAKE2b-256 checksum How to use checksums |
eb0e378e5e48eddbfe3181ee7e69ff7cf3224132fb7dfecc6852ee899d89b135
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for spring-config-client 1.0.0
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.