A familiar API from the Web, adapted to storing data locally with Python.
Project description
localStoragePy
A familiar API from the Web, adapted to storing data locally with Python.
Get started
-
Install using PyPi:
$ pip3 install localStoragePy
-
Import into your project:
from localStoragePy import localStoragePy
-
Setup localStorage:
localStorage = localStoragePy('your-app-namespace', 'your-storage-backend')
-
your-app-namespace
: whatever you want (example:me.jkelol111.mypythonapp
) excluding path separators/ \
or other disallowed characters in file name for your intended platform -
your-storage-backend
: your preferred storage backend (sqlite
by default).- Available storage backends:
text
: text files for each storage item.sqlite
: a single database for all storage items.json
: a single JSON file for all storage items.
- Available storage backends:
- Use your typical localStorage syntax to store/read your strings:
-
localStorage.getItem(item)
-
localStorage.setItem(item, value)
-
localStorage.removeItem(item)
-
localStorage.clear()
It's that familiar and simple.
When is this useful?
-
When you want to store tiny strings for your app...
-
Or your app's configuration in JSON...
Etcetra.
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 localStoragePy-0.2.3.tar.gz
.
File metadata
- Download URL: localStoragePy-0.2.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4446afc2df066f2dde33430a0fd9416d86515f798346fc9aa16a11f615f20d7e |
|
MD5 | 77725168078e1968e16bbb7ce3dcac24 |
|
BLAKE2b-256 | d33ffae8e6790ec592b15838dc1cef03693da01cab42e88b358fd2315346eb38 |
File details
Details for the file localStoragePy-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: localStoragePy-0.2.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcaaf07a5cbaab65c34cc4532a685b2a44243979d089d8d37a9c612ac743c0bf |
|
MD5 | 7a831ce934139d518d33efd8308cc999 |
|
BLAKE2b-256 | 8bf07667a4946744de78acafa3ad9def1421d5a7b0ec821e5f37af2386ea2834 |