Skip to main content

sqlsettingslib

Python lib: Store settings in a database

What is this library for?

In some projects you might want to store some variables for longer than you run the program. When restarting the program you might still want some settings to be the same. Those settings could be stored in a database. This lib does all the complicated part for you.

Usage

from sqlsettingslib import Setting

# Define the path for your database
path = "path/to/sqlsettingslib.sqlite3"

# Create a sqlsettingslib object:
s = Setting(path)

# Add some sqlsettingslib
s.add_setting(
    text_id="user_name",
    readable_name="User name",
    description="A name for the user",
    value="MyCoolUserName"
)

print(s["user_name"])
# -> "MyCoolUserName"

s["user_name"] = "AnotherCoolName"
print(s["user_name"])
# -> "AnotherCoolName"

s.update_setting(
    text_id="user_name",
    description="A unique name for the user."
)

print(s.get_setting(detail="description")[0])
# -> "A unique name for the user."

Release files for sqlsettingslib 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlsettingslib 0.0.9
File Size Uploaded
sqlsettingslib-0.0.9.tar.gz 3.2 kB Details

Release files / sqlsettingslib-0.0.9.tar.gz

Download URL sqlsettingslib-0.0.9.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
447f806712ac9c8d73bdbd0c5327a96d5324db4f734b6c1a7cb40bb351b82df3
BLAKE2b-256 checksum
How to use checksums
769344c9f4f42d9eeee17b06e3b35642a6c8deb1e42f32ced35ab91b756c7541
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.9 This release

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page