Cross-platform python module to store application config via native subsystems such as Windows Registry or NSUserDefaults.
Project description
Developers of cross-platform applications often face problems when they need to interact with the system. Config files are no exception, since every popular OS has its own format and guidelines.
nativeconfig addresses this problem in an elegant and Pythonic way:
import os
from nativeconfig import PreferredConfig, StringOption, IntOption
class MyConfig(PreferredConfig):
REGISTRY_PATH = r'Software\MyApp'
JSON_PATH = os.path.expanduser('~/.config/MyApp/config')
first_name = StringOption('FirstName')
last_name = StringOption('LastName')
age = IntOption('Age')
will store config in Registry on Windows, in NSUserDefaults on Mac OS X and in json-formatted file everywhere else.
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-2.0.3.tar.gz
(12.5 kB
view details)
File details
Details for the file nativeconfig-2.0.3.tar.gz
.
File metadata
- Download URL: nativeconfig-2.0.3.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5132dad226987d32466d6db49d11e4eb4c7080fdc0a08cfbaa72ac6ddec28a9c |
|
MD5 | 14c7218f3616ecc0d52d525ed86707d7 |
|
BLAKE2b-256 | 85077f1ff0c755040642e6c4f6bfd2544a5a9107551eba9c144350cf6b06ed07 |