Skip to main content

Cross-platform python module to store application config via native subsystems such as Windows Registry or NSUserDefaults.

Project description

https://travis-ci.org/GreatFruitOmsk/nativeconfig.svg?branch=master https://badge.fury.io/py/nativeconfig.png

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


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.4.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file nativeconfig-2.0.4.tar.gz.

File metadata

File hashes

Hashes for nativeconfig-2.0.4.tar.gz
Algorithm Hash digest
SHA256 25318989b5000bf7c59791a5b5f45ee99bfcd075d50e8d3e6547dd4ff194e8e7
MD5 438c669800f7be2df0f04b7690dbb43f
BLAKE2b-256 9eedf60001fa82b3466fb053590ebaec64a393d927f1272b87bbef60747b0b4c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page