Skip to main content

A familiar API from the Web, adapted to storing data locally with Python.

Project description

localStoragePy

HitCount PyPI Travis (.org) GitHub issues PyPI - License

A familiar API from the Web, adapted to storing data locally with Python.

Get started

  1. Install using PyPi: $ pip3 install localStoragePy

  2. Import into your project: from localStoragePy import localStoragePy

  3. 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.
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localStoragePy-0.2.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

localStoragePy-0.2.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for localStoragePy-0.2.3.tar.gz
Algorithm Hash digest
SHA256 4446afc2df066f2dde33430a0fd9416d86515f798346fc9aa16a11f615f20d7e
MD5 77725168078e1968e16bbb7ce3dcac24
BLAKE2b-256 d33ffae8e6790ec592b15838dc1cef03693da01cab42e88b358fd2315346eb38

See more details on using hashes here.

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

Hashes for localStoragePy-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bcaaf07a5cbaab65c34cc4532a685b2a44243979d089d8d37a9c612ac743c0bf
MD5 7a831ce934139d518d33efd8308cc999
BLAKE2b-256 8bf07667a4946744de78acafa3ad9def1421d5a7b0ec821e5f37af2386ea2834

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page