Skip to main content

操作更方便的配置文件读取模块

某ini文件
[table]
data = mydata
读取代码如下
import zinifile

ini = zinifile.load(文件名)
ini = zinifile.load_text(ini内容)
print(ini.table.data)
你可以将zinifile创建的实例当做一个字典或者迭代器.
for key in ini
for key, value in ini.items()
value = ini.get('键')
value = ini['键']

更新日志

18-11-15 1.0.4

1.空值不会再返回一个空的str了,而是返回None

2.用xx.xx如果属性不存在则返回zinifile.empty_node对象, 这个对象可以像_node一样使用, 但是获取任何数据都是空数据, 他的布尔检测为False

empty_node is None  #False
empty_node == None  #True
bool(empty_node)    #False

本项目仅供所有人学习交流使用, 禁止用于商业用途

Metadata

Release files for zinifile 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zinifile 1.0.4
File Size Uploaded Provenance
zinifile-1.0.4.tar.gz 2.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zinifile 1.0.4
File Interpreter ABI Platform
zinifile-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 kB

Release files / zinifile-1.0.4.tar.gz

Download URL zinifile-1.0.4.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f1a287b79360b6a90786528515bd382bef9a832b33671d78c8758d1d49b19282
BLAKE2b-256 checksum
How to use checksums
03f3979fe71f4330f32674dce84828e73e6b51c38268184a446eedcca04d5f39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Release files / zinifile-1.0.4-py3-none-any.whl

Download URL zinifile-1.0.4-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b74e9cadab6170a30a9e59a8f274d676d68e306b4d7119562a4142a8ca59ab4
BLAKE2b-256 checksum
How to use checksums
6d703edde02ffa28583725910d21c1f8119558a783fe743896ec94b591bfa4f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Security for zinifile 1.0.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page