Cross-platform python module to store application config vianative subsystems such as Windows Registry or NSUserDefaults.
Project description
Developers of cross-platform applications often face problems when application should interact with the system. And config files are no exception, since every popular OS has its own format and guidelines.
This package addresses this very problem in an elegant and Pythonic way:
import os
from nativeconfig import PreferredConfig, Option, ChoiceOption, IntOption
class SuperbConfig(PreferredConfig):
REGISTRY_PATH = r'Software\MyApp'
JSON_PATH = os.path.expanduser('~/.config/MyApp/config')
name = Option('Name')
sex = ChoiceOption('Sex', ['male', 'female'], default='female')
favorite_number = IntOption('FavoriteNumber', default=42)
We just created a config that will use appropriate locations on Windows, Mac OS X and Linux!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nativeconfig-1.0.0.tar.gz
(8.8 kB
view hashes)