Skip to main content

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


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)

Uploaded Source

Built Distribution

settingsfile-1.0.2-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

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