Skip to main content

A simple config lib

Project description

FastConf

Simple lib for configuration

pypi

Install

$ pip install fastconf

Example project structure

__main__.py
core/
    __init__.py
    config.py

main.py

from core import config
print('token:', config.token)

core/config.py

import fastconf
token = '...'
fastconf.config(__name__, 'yml')

Run project:

$ python .
token: ...

The config.yml file is created in the project root directory.

Change him:

token: 'MY_TOKEN'

Run again

$ python .
token: MY_TOKEN

fastconf.config(name, ext='json', file='config', main=main)

name - current name of config module
ext - type of config file (json, yaml, yml)
file - name config file
main - path to config file

core.config.ROOT_DIR return the project root directory.

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

fastconf-0.0.4.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

fastconf-0.0.4-py3-none-any.whl (3.5 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