viConfig
一个可以进行数据验证的服务器配置信息库
目录
安装
pip install viconfig
使用
定义配置信息
import pathlib
from Config import Config, Field, f_string, f_int, f_folder
def init_config():
config = Config()
config.add_fields([
Field('app', 'name', f_string, 'DATA-API'),
Field('app', 'version', f_string, '1.0.0'),
Field('app', 'description', f_string, '数据表信息管理系统(服务器)'),
Field('app', 'port', f_int, 8005),
])
config_obj = pathlib.Path('config.json')
if config_obj.exists():
config.load_from_json('config.json')
else:
config.save_to_json("config.json")
return config
配置信息获取
config.get('app', 'description')
依赖库
jsonpathlibdecimal
版权说明
该项目签署了MIT 授权许可。详细请查看LICENSE
Metadata
Release files for viconfig 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| viconfig-0.0.2.tar.gz | 5.0 kB | Without provenance | Details for viconfig-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viconfig-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for viconfig-0.0.2-py3-none-any.whl |
Total release size: 10.7 kB
Release files / viconfig-0.0.2.tar.gz
| Download URL | viconfig-0.0.2.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17c91fc0235bf80a664dec4078e0a904cd5d3e24dacaa585c219220d5b20cb11
|
|
BLAKE2b-256 checksum How to use checksums |
54a3907af4c2a6d719b0c6aa2e545ba235e9b15fd6d7ea8aeccb678eeacc64a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.9
|
Release files / viconfig-0.0.2-py3-none-any.whl
| Download URL | viconfig-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
254db0cbb31453cb4e6607415a9388b72966bbbfe4cd67c36735c471c192db1b
|
|
BLAKE2b-256 checksum How to use checksums |
e92f967241864adf7326bf2c1db85ca698ebc538dc5dabc757efae74225c89dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.9
|
Security for viconfig 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.