mini-init
简单辅助工具集合: 日志, 配置文件, 环境变量等
加载依赖
pip install mini-init
读取环境变量
# .env
PROJECT_NAME=mini-init
...
from dataclasses import dataclass
from miniinit import env
@dataclass
class Env:
# 环境变量
PROJECT_NAME: str = ''
...
env_data = env.get_env(Env)
# 更换路径
# env_data = env.get_env(Env, '**/.env')
print(env_data.PROJECT_NAME)
# mini-init
读取项目配置
# 默认, 不可修改
# config/application.yaml
app:
name: mini-init
version: 0.0.1
log:
is_use: true
yaml_path: config/log.yaml
banner:
is_show: true
file_path: banner.txt
welcome: welcome use mini-init (v0.0.1)
# 其他参数自行扩展
...
from dataclasses import dataclass
from miniinit import config
@dataclass
class Config(config.Config):
# 自定参数, 也可覆盖
...
config_data = config.get_config(Config)
print(config_data.app.name)
# mini-init
Metadata
Release files for mini-init 0.0.1
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 |
|---|---|---|---|---|
| mini-init-0.0.1.tar.gz | 4.2 kB | Without provenance | Details for mini-init-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mini_init-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for mini_init-0.0.1-py3-none-any.whl |
Total release size: 9.0 kB
Release files / mini-init-0.0.1.tar.gz
| Download URL | mini-init-0.0.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6065e56fcd58d11bcc30068d2a54c53dbd7c68da155e14a273a42f0fd166f9b9
|
|
BLAKE2b-256 checksum How to use checksums |
58e02672f5b27e71c56aa77ac1864ee505276e7345dcb7c477b3f695e8b364f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / mini_init-0.0.1-py3-none-any.whl
| Download URL | mini_init-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76c39023be546b71cde6fdf0967d3bfc3f674d4bc44649072bd2dd4522606da6
|
|
BLAKE2b-256 checksum How to use checksums |
d579a43b6434d1b6edca767f6f13019fbf0f399bbb223e824d0693259ba6c137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for mini-init 0.0.1
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.