Yanked
This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.2 instead.
ablerConfig
简介
这是一个用于处理配置信息的Python包。它可以帮助应用程序读取、写入和验证配置文件。该包主要是供彭彭自用的。
特点
- 支持JSON5格式的配置文件。
- 可以验证配置文件的格式和内容。
- 可以使用默认值填充缺失的配置项。
- 可以将配置文件转换为Python对象,以便更方便地访问和修改。
- 可以将Python对象转换为配置文件。
依赖项
- pyjson5
- json5
安装
您可以使用pip安装abler_config:
pip install ablerConfig
使用方法
加载配置文件
您可以使用abler_config.Config()函数加载配置文件。例如:
import ablerConfig as config
config.Config(default='my-config', show_message=my_show_message)
引用配置项
您可以使用abler_config.Config.object_of()函数引用配置文件中的配置对象,也可以使用abler_config.Config.value_of()函数将引用配置文件中的简单配置项。例如:
from abler_config 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.2.tar.gz
(5.4 kB
view details)
File details
Details for the file ablerConfig-0.0.2.tar.gz.
File metadata
- Download URL: ablerConfig-0.0.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b6af8b16f326c273d5bc42ae30270858445ff983dbb56ad011d687fd4b96416
|
|
| MD5 |
9788cba4d6e9bc2559eafa70bb1a1e2b
|
|
| BLAKE2b-256 |
459c3a1d2d5b4ea795caeaefa146823a0e465407179fdd57e07fe80053aa92f6
|