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..rmdirs()
will remove any program-specific directories that would have been created by config-better.
Installation
pip install config-better
Developing
- Clone the repo
git checkout -b some-feature-or-bugfix
- Do work
- Test with
pytest
(add tests to maintain coverage as best as possible) - Run
yapf -ir .
andisort -rc .
to standardize. - 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-1.0.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for config_better-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4364e95b216170e3d46132ddebb49a21c202c75f1ddc8f9072089f43895d5845 |
|
MD5 | 7ff64409ccfde2ad12d82b3bd92a88e3 |
|
BLAKE2b-256 | 07f5801b99804aaaeecf4796b1a6057e2cf6749ba2df25746c4418e0d1cc4e6f |