Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Python library to manage application user settings

Project description

UserConf

Python library to manage application user settings

Introduction

This library allows you to write and read key-value settings for a Python application in a JSON file inside the home directory of the user who is running the application.

Usage example

import userconf as uc

# Set the working application ID. The JSON file containing the settings will be
# saved in a directory which name is the dot character "." followed by the ID
# provided when calling the following function. This directory will be created
# inside the user's home directory.
uc.set_application_id("exampleapp")

# Write a setting value. This is done by providing its ID and value. The value
# can be any JSON serializable object (e.g. a string, a list, a dictionary...).
uc.set_setting_value("setting_example", "Example value")

# Read a setting value. This is done by providing its ID and an optional
# default value that will be returned if the setting doesn't exist.
v = uc.get_setting_value("setting_example", "Default value")

Function list

get_application_id()
set_application_id(id)
get_all_setting_ids()
setting_exists(id)
get_setting_value(id, default_value = None)
set_setting_value(id, value)
clear_setting(id)
clear_all_settings()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for userconf, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size userconf-0.2.0-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size userconf-0.2.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page