Skip to main content

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.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ablerConfig-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ablerConfig-0.1.0.tar.gz.

File metadata

  • Download URL: ablerConfig-0.1.0.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

Hashes for ablerConfig-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d84821d664b481a61cf00bf1ddda3019b968b97738d8e16cf6b21bc82262e53
MD5 8e5e19eb8ccb46648e25f8e686cbfc52
BLAKE2b-256 f07a447e0ca3f45d69751f82ce78eecd9122cc0f703f199a6f3c68368d4b5774

See more details on using hashes here.

File details

Details for the file ablerConfig-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ablerConfig-0.1.0-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

Hashes for ablerConfig-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 601441556277b4e6ea4d70bb4bb4b3ae646d4cedf217f488f445ae3ac0ffaf7e
MD5 f710a43b75fcab15b21c13b9529a4e95
BLAKE2b-256 a04d7376d43e1a52781f3adc79a5163b5b405a1dc900f489fa1b58a051967926

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page