Skip to main content

A simple but useful python library that helps you to manage user preferences

Project description

PREFS logo

Python Version PYPI Downloads Stars

Why?

PREFS's purpose is to facilitate the process of store and manage user preferences, simple but useful library.

Installation:

On windows: pip install PREFS

On Mac and Linux: pip3 install PREFS

Syntax:

PREFS library has inside a class also called PREFS, you have to create an instance of this class to call all functions. Each new instance is a new prefs file: This class has one required parameter, which is a dictionary with the default preferences, default means the preferences that all users will have at first time.

UserPrefs = PREFS.PREFS(prefs = {"theme": "light", "lang": "en"})

The main methods are:

  • ReadPrefs(): Returns a dictionary with your prefs.

  • WritePrefs(): Requires two arguments, first the name of the pref that you want to change (if pref exists) or create if it doesn't, and second argument is the value that you want to asign to the pref.

  • ConvertToJson(): Converts the prefs file to a json one (with the same filename)

Methods outside PREFS class:

Documentation

PREFS documentation can be found at https://github.com/Patitotective/PREFS/wiki with more examples and information.

Links

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

PREFS-0.0.99.tar.gz (7.0 kB view hashes)

Uploaded Source

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