Skip to main content

A small utility for managing script specific settings and multiple configurations

Project description


For Python 3.8+.

A small utility for managing script-specific settings and multiple configurations. Configuration files are stored in Appdata/Roaming as .json files. Uses only the standard library.


This utility contains a template class SmallConfig which handles multiple configuration files for the same script.

Create a child class of SmallConfig that implements the manager_name and default_config properties.

from smallconfig import SmallConfig as SmallConfigTemplate

class SmallConfig(SmallConfigTemplate):
    def manager_name(self):
        return 'ExampleManagerName'
    def default_config(self):
        return {
            'key': 'value',
            'is_example': True,

Then create an instance of the class. Set a default configuration to clean up function calls.

config = SmallConfig('configuration.json')
config.get('key') # returns 'value'
config.set('key', 'othervalue')
config.get('key') # returns 'othervalue'
config.get('key') # returns 'value'
config.get('key', 'configuration.json') # returns 'othervalue'

Other useful functions, mostly for juggling multiple configurations:

# returns a list of full file paths to configs with given manager name

# gets the config dictionary of a given config name

# reloads the cache of a config directly from a file

# creates a new configuration file (with default settings)

# sets the default configuration

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

smallconfig-1.0.1.tar.gz (3.8 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