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 details)

Uploaded Source

File details

Details for the file PREFS-0.2.60.tar.gz.

File metadata

  • Download URL: PREFS-0.2.60.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for PREFS-0.2.60.tar.gz
Algorithm Hash digest
SHA256 95d83c1662d4ca77844d917e7dbe5967f0692e829fe9159eb9c0044131023e88
MD5 a1fc9686fa4f18f2d32821073ffc52d5
BLAKE2b-256 fffd91a54bbdd7c6bdff80e909d334b25549016fd4238f8db6191a01ed0a241c

See more details on using hashes here.

Supported by

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