Metadata-Version: 2.0
Name: yzconfig
Version: 1.0
Summary: Easy configuration for your project
Home-page: https://github.com/ykshatroff/yzconfig
Author: Yuriy Shatrov
Author-email: ykshatrov@ya.ru
License: Apache Software License
Keywords: config settings
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Provides-Extra: dev
Requires-Dist: check-manifest; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'

yzconfig
========

![build](https://travis-ci.org/ykshatroff/yzconfig.svg?branch=master)

Simple application configuration tool for Django (and others)

Summary
-------

`yzconfig` allows you to:

* Define all settings for all of your Django project's applications in one python object (usually, a module)
* Use name prefixes to instantiate the settings object of an application 

Usage
-----

`yzconfig` takes an arbitrary object and populates `settings` with values from its attributes whose names
are constructed as `prefix + attr` where `attr` is a `settings` class attribute and `prefix` is given as argument to
`settings` constructor.

An application's settings are defined in a class which inherits from `YzConfig`, then a settings object
is instantiated with the desired prefix:
```python
from yzconfig import YzConfig

class Settings(YzConfig):
    VALUE = "default"
    _SKIPPED_VALUE = 'skipped'

settings = Settings('TEST_')
```

If your Django settings contain a `TEST_VALUE` property, then the `settings` object's `VALUE` will contain its value,
otherwise it will remain with `"default"`.

Attributes beginning with `_` will not be overwritten. 

`yzconfig` can be used with Django or standalone. For the latter case, it's possible to provide a python dotted path
to the settings object in `YZCONFIG_MODULE` environment variable. The default is to import `settings`. 
To be used with Django, no extra actions are required.


