Configure your application in a friendlier and more consistent way!
Project description
config-better
Make use of directories for configuration / data / caching better and more user-friendly!
This module provides support for the XDG Base Directory specification, and OS-friendly fallbacks for Windows, Mac OS, and Linux if not otherwise specified.
Usage
import os.path
import configbetter
c = configbetter.Config('appname')
with open(os.path.join(c.config, 'config.json')) as conf:
# ...
Available properties of Config
:
.cache
, which points to$XDG_CACHE_HOME
if available, otherwise uses a generic system equivalent..config
, which points to$XDG_CONFIG_HOME
if available, otherwise uses a generic system equivalent..data
, which points to$XDG_DATA_HOME
if available, otherwise uses a generic system equivalent.
Additionally, the following method is provided:
.makedirs()
will create the cache, config and data directories if they do not already exist, including all parent directories.
Installation
pip install config-better
Developing
Clone the repo, make a new branch, add features/fixes/etc, test with python setup.py test
and make a PR.
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
config-better-0.2.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for config_better-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b753abee0deb02ba21e9f302777200be4a312821fc39786385c5a49589cbc968 |
|
MD5 | d481eca413e40d8a38bbf8e764e951fb |
|
BLAKE2b-256 | b721de536fd8fdfdf058fb68111aa84fec1d83747111d98bd2bee4a720140a4d |