Simple object-oriented config library, where your settings are objects
Project description
object-settings
Simple object-oriented config library, where your settings are objects.
Their values get saved to a standard config location, depending on the os (uses appdirs
package for paths). The file is automatically written and read in the background, so you don't have to worry about it, and it's quick to define and use settings (see examples below)
Usage
import settings
settings.setup("Your app name")
your_option1 = settings.Toggle("Your first option label")
your_option2 = settings.Number("Your second option label")
Examples
You can set a font size at the top of your ui file:
font = settings.Number(default=14)
...
someuilib.Label("Bababooey", size=font.value)
...
someuilib.Textbox("Lorem ipsum dolor...", font_size=font.value)
...
Or if a setting is only checked in one place, it can be used without defining a variable:
if settings.Toggle("Update app automatically", default=True):
# do update
(though it doesn't matter if the same setting is initialized multiple times)
Setting types
List of currently available setting types and the variables they use as values:
- Toggle (bool)
- Choice (any) [from a list of options]
- Multichoice (list) [of things from a list of options]
- Text (str)
- Path (str)
- Number (int)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file object-settings-0.1.tar.gz
.
File metadata
- Download URL: object-settings-0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7dc47cce22d50f223c5833b7cd42eb9eefc5ecf4ae8acb51530acb573ed4256 |
|
MD5 | 4fca1d4b5a189186240852e9acaa89f3 |
|
BLAKE2b-256 | 2ab39f776c105290b3a8dec3723b3c33a1447ecb7b994240639ba9a67f9593ea |
Provenance
File details
Details for the file object_settings-0.1-py3-none-any.whl
.
File metadata
- Download URL: object_settings-0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91a4d45373a540cf1f235b2d13efa65ebcf05edd0a1928d931b3af770c45ac05 |
|
MD5 | 0b394df5519ef57488c3d1e3ee207bb6 |
|
BLAKE2b-256 | 44c595f92d611c081b066ae49ebeb42e720b72c2b915f9426aa7887e184dd748 |