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', 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'))

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.1.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.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ablerConfig-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8953279d21788848b5a153af6acdc7a736741f8c50afd9be8dea93b1f3830f4f
MD5 e143eae062784f1b9cf3e95af3c803d5
BLAKE2b-256 6526ccc92ac5e4315d0dd7780979f52a41114620ea3d6ecf844d58559b45322e

See more details on using hashes here.

File details

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

File metadata

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

Hashes for ablerConfig-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d462defc504b6f66d6794b6d4c4663784b330d5240ddb8ee4d283ab07409406
MD5 412afc24df3930f6cd6eb66d20eabf6a
BLAKE2b-256 425d53c2d9eb3d68da82deffce8b86941413848201f7effadc1d84ad2abac403

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