Memorize settings in Python easily. Autoload and autosave settings to a file.
Project description
SettingsFile
Autoload and autoupdate your configuration with native implementation
Installation
$ pip install settingsfile
Quickstart
from settingsfile import Settings
settings = Settings('config.json')
# use settings object instance as a dict
settings['language'] = 'fr'
# however, you can use it via class attributes too with caution
settings.language = 'fr'
print(settings['language']) # 'fr'
print(settings.language) # 'fr'
While using the module via class attributes, there are some names that are reserved and cannot be used as they would conflict. Hence, avoid using commonplace names via attributes such as path, json, name. Of course, you can use these names in peace via dict-like assignment.
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
settingsfile-1.0.2.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for settingsfile-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2aff107ea202e70197f632084e95fc75f47c09f2f81cc76098e95ac68d286a1 |
|
MD5 | b7d6603bcdb74d05f5ec76b45692e4c8 |
|
BLAKE2b-256 | 2069bce28236fb0ef2fc821c7f996ea7c7b29c7a88d82ef912164916ebc6af1d |