Configure your application in a friendlier and more consistent way!
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.
import os.path import configbetter c = configbetter.Config('appname') with open(os.path.join(c.config, 'config.json')) as conf: # ...
Available parameters for creating a
force_unixallows you to force using Unix-like paths on Windows/Darwin if desired. This isn't really recommended on Windows but on Darwin it seems as though programs without a GUI usually use Unix-like configuration paths while GUI apps use the "standard" Darwin paths. By default this is
Available properties of
.cache, which points to
$XDG_CACHE_HOMEif available, otherwise uses a generic system equivalent.
.config, which points to
$XDG_CONFIG_HOMEif available, otherwise uses a generic system equivalent.
.data, which points to
$XDG_DATA_HOMEif available, otherwise uses a generic system equivalent.
Additionally, the following methods are 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.
pip install config-better
- Clone the repo
git checkout -b some-feature-or-bugfix
- Do work
- Test with
pytest(add tests to maintain coverage as best as possible)
yapf -ir .and
isort -rc .to standardize.
- Make a PR.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for config_better-1.1.0-py3-none-any.whl