Configloaders is a Python library that allows you to easily load configuration from various types of configuration files and inject them into various types of objects, such as classes, dictionaries, functions, and methods.
Project description
Configloaders
Configloaders is a Python library that allows you to easily load configuration from various types of configuration files and inject them into various types of objects, such as classes, dictionaries, functions, and methods.
Installation
You can install Configloaders using pip:
pip install configloaders
Usage
Loading configuration from a file
Configloaders supports loading configuration from various types of configuration files, including YAML, JSON, INI, and Python files.
import configloaders
name = 'jack'
age = 18
configloaders.load(globals())
Injecting configuration into an object or class
Configloaders supports injecting configuration into various types of objects, including classes, dictionaries, functions, and methods.
import configloaders
@configloaders.config
class config:
name = 'jack'
age = 18
Using configuration in a function or method
Configloaders supports using configuration in a function or method by using the @config
decorator.
import configloaders
@configloaders.config
def hello(name, age):
print(name, age)
Supported file formats
Configloaders supports the following file formats:
- JSON
- INI
- PICKLE
- PY
- TOML
- TXT
- XML
- YAML
Supported object types
Configloaders supports the following object types:
- Classes
- Dictionaries
- Functions
- Methods
- argparse.ArgumentParser
Contributing
If you would like to contribute to Configloaders, please submit a pull request or open an issue on GitHub.
License
Configloaders is licensed under the MIT License. See the LICENSE file for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for configloaders-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64427964739cfcc48e33178c3c52e3e9d528cd797c00476a3a1679a86a0196c5 |
|
MD5 | 6b490919dd33288f5f0566a600010392 |
|
BLAKE2b-256 | a85228b828a86fcb02f4dc207ba762122f536b662a1ce74dc9a7957a34a8bd33 |