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.

Files for localStoragePy, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size localStoragePy-0.2.3.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View
Filename, size localStoragePy-0.2.3-py3-none-any.whl (4.7 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page