configloaders-0.4.9
توضیحات
Load configurations from a variety of configuration files and use them easily
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | configloaders-0.4.9 |
| نام | configloaders |
| نسخه کتابخانه | 0.4.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | jawide |
| ایمیل نویسنده | jawide@qq.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/configloaders/ |
| مجوز | - |
Load configurations from a variety of configuration files and use them easily
# Examples
## Load configuration file if it exists
```python
import configloaders
username = 'username'
password = 'password'
phone = 123456789
auto_login = True
configloaders.load_json(globals())
```
## Load the configuration and update it on exit
```python
import configloaders
username = 'username'
password = 'password'
phone = 123456789
auto_login = True
configloaders.load_json(globals(), save_on_exit=True)
```
## Load the configuration and require the configuration file to exist
```python
import configloaders
username = 'username'
password = 'password'
phone = 123456789
auto_login = True
configloaders.load_json(globals(), required=True)
```
## Manually save the configuration
```python
import configloaders
username = 'username'
password = 'password'
phone = 123456789
auto_login = True
configloaders.load_json(globals()).dump()
configloaders.load_json(globals()).dump(original=True)
configloaders.dump()
configloaders.dump(original=True)
```
## Take all configuration items as command line arguments
```python
import configloaders
username = 'username'
password = 'password'
phone = 123456789
auto_login = True
configloaders.load_argparse(globals())
# or
import argparse
parser = argparse.ArgumentParser()
configloaders.load_argparse(globals(), parser)
parser.parse_args()
```
# Features
* Variables of the module type and those prefixed with "__" are ignored
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl configloaders-0.4.9:
pip install configloaders-0.4.9.whl
نصب پکیج tar.gz configloaders-0.4.9:
pip install configloaders-0.4.9.tar.gz