🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

localStoragePy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localStoragePy

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

0.2.3
PyPI
Maintainers
1

localStoragePy

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

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.
  • 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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts