Skip to main content

一些好用的函数和类

1.配置文件

yaml_file yaml 格式的配置文件

config.yaml

config.yaml
host: localhost
port: 123

config.xlsx
biaoge

测试代码

from l0n0lutils.files import *


config = simple_load_config(yaml_file)
print(config.get("host"))
print(config.get("port"))


config = simple_load_config(xl_file)
print(config.get(1))
print(config.get(2))
print(config.data)


config = simple_load_config(xl_kv_file)
print(config.get(1))
print(config.get(2))
print(config.data)

输出结果:

localhost
1234
{'id': 1, 'a': 'asdf', 'b': 1.2, 'c': 4}
{'id': 2, 'a': 'adsf', 'b': 2.2, 'c': 5}
{1: {'id': 1, 'a': 'asdf', 'b': 1.2, 'c': 4}, 2: {'id': 2, 'a': 'adsf', 'b': 2.2, 'c': 5}, 3: {'id': 3, 'a': 'fda', 'b': 3.2, 'c': 6}, 4: {'id': 4, 'a': 'dae', 'b': 4.2, 'c': 7}}
asdf
adsf
{'int': 'string', 1.0: 'asdf', 2.0: 'adsf', 3.0: 'fda', 4.0: 'dae'}

xl_file excel格式的配置文件

Metadata

Release files for l0n0lutils 1.0.14

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

Source distribution (sdist)

Source distribution for l0n0lutils 1.0.14
File Size Uploaded Provenance
l0n0lutils-1.0.14.tar.gz 24.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 41.8 kB

Release files / l0n0lutils-1.0.14.tar.gz

Download URL l0n0lutils-1.0.14.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b98761c58c67a6fef103b356a77e504bf94e37b23cb6d507df77e45f38296051
BLAKE2b-256 checksum
How to use checksums
6ebfa1ab07db565e63dbf5c14fb5f36e0245b47f2d133242ed0a8ab1f0b49c67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.3

Release files / l0n0lutils-1.0.14-py3-none-any.whl

Download URL l0n0lutils-1.0.14-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa01459b1d2ef3f1f38637f9672d98009dedda5030c35504e1d1f517ff4fbf1c
BLAKE2b-256 checksum
How to use checksums
b243378cc0a9ee782ba8a08b8e73ece2740f5096e8bc4d015cc889449ccd4ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.3

Security for l0n0lutils 1.0.14

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.

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