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)
| 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
|