ablerConfig
简介
这是一个用于处理配置信息的Python包。它可以帮助应用程序读取、写入和验证配置文件。该包暂时只供彭彭项目组自用。
特点
- 支持JSON5格式的配置文件。
- 可以验证配置文件的格式和内容。
- 可以使用默认值填充缺失的配置项。
- 可以将配置文件转换为Python对象,以便更方便地访问和修改。
- 支持内部配置文件和本地外部配置文件。
依赖项
- pyjson5
- json5
安装
您可以使用pip安装abler_config:
pip install ablerConfig
使用方法
加载配置文件
您可以使用ablerConfig.Config()函数加载配置文件。例如:
import ablerConfig as config
config.Config(default='my-config', show_message=my_show_message)
引用配置项
您可以使用ablerConfig.Config.object_of()函数引用配置文件中的配置对象,也可以使用ablerConfig.Config.value_of()函数将引用配置文件中的简单配置项。例如:
from ablerConfig import Config, ConfigNode
conf = Config.object_of('alarm_control.state_send')
addr = tuple(Config.value_of('net_gate.tt_addr'))
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ablerConfig-0.0.9.tar.gz
(5.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ablerConfig-0.0.9.tar.gz.
File metadata
- Download URL: ablerConfig-0.0.9.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aa2c153395df6205042514ca2e7cccc7e69ff38b838eb1b77ae59517cb40028
|
|
| MD5 |
19c8bf1856af61b8b74f6898a6615144
|
|
| BLAKE2b-256 |
d6a493040fcf8deecf5552d5c5900236604bb5ce90effcde5b5f45d15424c032
|
File details
Details for the file ablerConfig-0.0.9-py3-none-any.whl.
File metadata
- Download URL: ablerConfig-0.0.9-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bd9f4eb6658f04da3272395da0a21dbc69a60b6e20ca880fdd63c5e5747d476
|
|
| MD5 |
3238eae97b634a98ec5ee998f9d4ab25
|
|
| BLAKE2b-256 |
cd79d567d0f0a18b5b7f29122076f4811de26087d86e2461bd04c2443ed015ae
|