Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

configloaders-2.2.0.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

configloaders-2.2.0-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page