配置信息处理包
Project description
ablerConfig
简介
这是一个用于处理配置信息的Python包。它可以帮助应用程序读取、写入和验证配置文件。该包暂时只供彭彭项目组自用。
特点
- 支持JSON5格式的配置文件。
- 可以验证配置文件的格式和内容。
- 可以使用默认值填充缺失的配置项。
- 可以将配置文件转换为Python对象,以便更方便地访问和修改。
- 支持内部配置文件和本地外部配置文件。
依赖项
- pyjson5
- json5
安装
您可以使用pip安装abler_config:
pip install ablerConfig
使用方法
加载配置文件
您可以使用ablerConfig.Config()
函数加载配置文件。例如:
import ablerConfig as config
config.Config(default='my-config', local_dir='ex-conf', 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'))
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
ablerConfig-0.1.2.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file ablerConfig-0.1.2.tar.gz
.
File metadata
- Download URL: ablerConfig-0.1.2.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 | 30b6c5e1d294d17bd237f1b2e85dbd71e8d20c5fe15025f82eddb5c739c69000 |
|
MD5 | eb8e081bbffa1e2f03b52b661f86c60d |
|
BLAKE2b-256 | 208a5fba15b6b9746d604325952205b753408569d562d5d808517dfcc850bbb4 |
File details
Details for the file ablerConfig-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: ablerConfig-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.7 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 | c581959f270f6396f71821c18faecf48357b16f8f55d1a73e1dd5715c1493247 |
|
MD5 | 1a379c305399f5af17b8f3ce366baf3d |
|
BLAKE2b-256 | c2ddadf1d806e7d172489b44f8b92b18ddf88f17b446bdfa529ebaa365568fd2 |