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.2.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

configloaders-2.2.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file configloaders-2.2.2.tar.gz.

File metadata

  • Download URL: configloaders-2.2.2.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.8 Windows/10

File hashes

Hashes for configloaders-2.2.2.tar.gz
Algorithm Hash digest
SHA256 01edb64b2608d4e9e7482430376fb7852b89d4835d99b80976958388a4920435
MD5 a27dc01209bde62bf88a8347ebbd1f0a
BLAKE2b-256 af0aa589fc07d03a06ccdeb44d311eafa26d7b89bd164c68c3cc4dd79328bed9

See more details on using hashes here.

File details

Details for the file configloaders-2.2.2-py3-none-any.whl.

File metadata

  • Download URL: configloaders-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.8 Windows/10

File hashes

Hashes for configloaders-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63047181d57e28744375dc2ef5af2922283f26dcb8c253530b8bda65e9da0092
MD5 220d6502bceca5c66d78f5bd5642451b
BLAKE2b-256 4d888c18b4890440a8e466a41888416e72ecea466bb924894009c64681009122

See more details on using hashes here.

Supported by

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