No-config

Latest version: v0.1.4

Safety actively analyzes 714973 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

0.0.2

增加功能

> 在类型注入时可以注入函数,对配置数据进行处理。

1. 配置文件

yaml
app:
name: type-inject-name


2. 源码文件

python
from no_config import Config
from os import path

def split_name(name):
return name.split('-')

Config(type=dict(name=split_name))
class App:
name = None

if __name__ == '__main__':
Config.init(path.join(path.dirname(__file__), 'type_inject_func.yaml'))
print(App.name)

0.0.1

no_config

致力于更简单的配置。

快速开始

1. 配置文件
yaml
创建配置文件start.yaml
user:
username: ncdhz
password: ncdhz


2. 源码文件

python
from os import path
from no_config import Config

配置注入
Config
class User:
password = None
username = None

if __name__ == '__main__':
配置初始化
全局只需一次初始化
在更改配置之后可以通过此函数刷新配置
Config.init(path.join(path.dirname(__file__), 'start.yaml'))
print(User.password)
print(User.username)


官方文档

<https://ncdhz.github.io/no_config>

Page 2 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.