abcDict
example
# abctest.yaml
path: ${ALLUSERSPROFILE}
info:
none1: ''
none2: None
name: ${name}
name_default: ${name|default:msbrm}
age: ${age}
age_default: ${age|default:18}
age_default_int: ${age|default:18|type:int}
info_str: 我是name:${name},name_default:${name|default:$<name>},今年刚满age:${age},age_default:${age|default:18}岁
info_str2: ${HOME}xxxxxxx${age|default:18|type:int}xxxxxxx${HOME}
file_path: /home/${FILE|default:abc}/abc.test
# abctest.py
import sys
from pathlib import Path
FILE_PATH = Path(__file__)
sys.path.append(str(FILE_PATH.parent.parent))
from src import AbcDict
yaml_file = FILE_PATH.with_suffix('.yaml')
abcDict = AbcDict(yaml_file)
print(abcDict.path)
print(abcDict.info.age_default_int)
print(type(abcDict.info.age_default_int))
print(abcDict)
abcDict.dump(yaml_file.with_stem('save')) # save as save.yaml
# cmd output
> python .\test\abctest.py
C:\ProgramData
18
<class 'int'>
{'path': 'C:\\ProgramData', 'info': {'none1': '', 'none2': 'None', 'name': None, 'name_default': 'msbrm', 'age': None, 'age_default': '18', 'age_default_int': 18}, 'info_str': '我是name:None,name_default:$<name>,今年刚满age:None,age_default:18岁', 'info_str2': 'C:\\Users\\Administratorxxxxxxx18xxxxxxxC:\\Users\\Administrator', 'file_path': '/home/abc/abc.test'}
# save.yaml
file_path: /home/abc/abc.test
info:
age: null
age_default: '18'
age_default_int: 18
name: null
name_default: msbrm
none1: ''
none2: None
info_str: 我是name:None,name_default:$<name>,今年刚满age:None,age_default:18岁
info_str2: C:\Users\Administratorxxxxxxx18xxxxxxxC:\Users\Administrator
path: C:\ProgramData
Metadata
Release files for abcDict 0.0.6
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 | |
|---|---|---|---|---|
| abcdict-0.0.6.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abcDict-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / abcdict-0.0.6.tar.gz
| Download URL | abcdict-0.0.6.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
218105cb634901980296fcdaf12b176252bbcbe5e3b3df7630b4a85b5ab97b18
|
|
BLAKE2b-256 checksum How to use checksums |
304ef6845cc899fbe638e55afae98b78c678cfa47403ef07db1f2aecbceb8b64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.1
|
Release files / abcDict-0.0.6-py3-none-any.whl
| Download URL | abcDict-0.0.6-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c095031df6e8cfd9365b99d17252ef105c78797bfd96cbd2589b0f7ef7e1806c
|
|
BLAKE2b-256 checksum How to use checksums |
5b0d376f4099c2da525decbfcdf97eb5ab360cccb8d35aa43d08520523edd1e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.1
|
Security for abcDict 0.0.6
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.