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
Hashes for localStoragePy-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baec0294a222dcd9c1c983cbeca4440064b9899b0dd9700018e971e679803c1d |
|
MD5 | f22d6d7e247c8ad4894012b6436e248d |
|
BLAKE2b-256 | 1578607a059bc69edfaf4c70ae1c1b73d77268270363fe1e911a3611b6df4161 |