Skip to main content
Version: 1.0.0

Command Line Interface

PREFS has a simple CLI tool that you can access from your terminal right after installing PREFS via Pypi.

Commands

bundle

Bundle PREFS file into a PREFs resource to use to build your app.

info

See an usage example here.

Usage: prefs bundle [OPTIONS] PATH

Bundle a PREFS file into a Python module

Options:
-o, --output TEXT The output path
-a, --alias TEXT The alias to be referenced as the path
--help Show this message and exit.

Example:

prefs bundle theme.prefs --output resources/theme.py 

It will create a (PREFS) resource module file called theme.py inside the resources directory:

import prefs
from resources import theme

theme_data = PREFS.read(":/theme.prefs") # :/ and the alias

(To better understand the above example read this).

Info

If some directory doesn't exist in the output path it creates it.

read

Given the path of a PREFS file, reads it's content and print it.

Usage: prefs read [OPTIONS] PATH

Reads a PREFS file and displays its content as a Python dictionary

Options:
--help Show this message and exit.

Example:

settings.prefs
#PREFS
lang='en'
theme=>
background='#199396'
font='UbuntuMono'
prefs read settings.prefs

>>> {"lang": "en", "theme": {"background": "#199396", "font": "UbuntuMono"}}

about

Usage: prefs about [OPTIONS]                                                              

Shows information about PREFS

Options:
--help Show this message and exit.