Python3 Apollo Client
Project description
简介
基于apollo-client,修改的 Apollo 客户端。
使用示例
安装
pip install -U python-apollo
使用示例
from apollo.client import ApolloClient
# 获取 ApolloClient 实例
apollo = ApolloClient(app_id='xxx', config_server_url='http://127.0.0.1:8090', cycle_time=30)
# 从指定的 namespace 中获取 host 的值。
apollo.get_value("host", namespace='application')
# 从指定的 namespace 中获取 host 的值, 如果没有则去公共 namespace 中获取。如果都存在则私有的优先级高于公共的。
apollo.get_value("host", namespace='application', public_namespace=["common.smtp"])
# 获取指定 namespace 下的所有配置值
apollo.get_values(namespace='application')
# 获取指定 namespace 和 public_namespace 下的所有配置值。如果都存在则私有的优先级高于公共的。
apollo.get_values(namespace='application', public_namespace=["common.smtp"])
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
python-apollo-0.0.3.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file python-apollo-0.0.3.tar.gz
.
File metadata
- Download URL: python-apollo-0.0.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df53cf4a2a5abfa8eb3d7ab6b8ef4e0ce7fa5420b9e6390be5f35877b135f81a |
|
MD5 | 678fab443c275097ac27ba9bba9d79ff |
|
BLAKE2b-256 | 493925170f58d7575806842f76505f8c2224ca5960f9c857717b312bfc979fad |
File details
Details for the file python_apollo-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: python_apollo-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7acb7deb6b2c812fe08ec45243467c283d745df6db658b6a3892266bcfdc0aa6 |
|
MD5 | d7e88ece423255fc5da02780612394b2 |
|
BLAKE2b-256 | 56cfe43678cad26613d00ee0afaebc7dea2758d6a6885270fc7f6f5959f4371a |