Skip to main content

Package to manage configuration for you project.

Project description

Polidoro Config

Polidoro Config it is a configuration manager for you project

Code Quality CodeQL Upload Python Package Documentation Status
Latest Version GitHub Release Date
GitHub commits since latest release (by SemVer including pre-releases) GitHub last commit
GitHub issues GitHub pull requests

Coverage Quality Gate Status Security Rating Maintainability Rating Reliability Rating
Code Smells Duplicated Lines (%) Vulnerabilities Bugs Technical Debt
DeepSource
PyPI

Python Versions
GitHub branch check runs
GitHub branch check runs
GitHub branch check runs

Basic Usage

Create a class inheriting from ConfigBase

from pconfig import ConfigBase

class Config(ConfigBase):
	DB_HOST = 'localhost'
	ENVIRONMENT = 'development'
	...

When the class is instantiated will load from environment variables.

# script.py
from pconfig import ConfigBase

class Config(ConfigBase):
	MY_VAR = 'default_value'

print(Config.MY_VAR)
>>> python script.py
default_value

>>> MY_VAR="new_value" python script.py
new_value

If you have the python-dotenv installed will load the .env automatically. Also, you can load from a .yaml file setting the file path in the Config class:

# script.py
from pconfig import ConfigBase

class Config(ConfigBase):
	file_path = "my_config.yml"
	MY_VAR = 'default_value'

For more information see the Documentation

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

polidoro_config-1.0.1.tar.gz (17.8 kB view hashes)

Uploaded Source

Built Distribution

polidoro_config-1.0.1-py3-none-any.whl (10.9 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