Skip to main content

Python library that helps you to store and manage user preferences and settings.

Reason this release was yanked:

Bugs when nested dictionaries in PREFS file.

Project description

PREFS

PREFS is a Python library to store and manage preferences and settings.

PREFS logo

Python Version PYPI Downloads Stars Watchers
Build Last commit Size Top languages License MIT
made-with-python

PREFS stores a Python dictionary in a total human-readable file, the PREFS file is created when it can't find it (normally the first time you run the program), otherwise if the file already exists it just read it's content.

Installation:

On windows: pip install PREFS

On MacOS and Linux: pip3 install PREFS

Syntax:

Each PREFS file is an instance of the PREFS class:
The PREFS class has one required parameter, which is a dictionary with the default preferences (used to create the file when it can't it).

default_prefs = {
  "theme": "light", 
  "lang": "en", 
  "keybindings": {"Ctrl+C": "Copy", "Ctrl+V": "Paste", "Ctrl+X": "Cut"}
}

user_prefs = PREFS.Prefs(default_prefs)

This code will create a file like this:

#PREFS
theme='light'
lang='en'
keybindings=>
  Ctrl+C='Copy'
  Ctrl+V='Paste'
  Ctrl+X='Cut'

A total human readable file that supports cascade/tree in nested dictionaries.

Other functions

  • read_json_file().
  • read_yaml_file().
  • read_prefs_file().
  • convert_to_prefs().

Documentation

PREFS documentation can be found at https://patitotective.github.io/PREFS/docs/ with more examples and information.

Extra info.

About

v0.2.60

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.2.60.tar.gz (16.3 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