Skip to main content

A tiny persistent key–value store built on SQLite.

Project description

Pica: Persistent key-value storage

image

Overview

Pica pica: The Eurasian magpie. Known for collecting shiny things

The pica package is very similar to shelve, but uses SQLite behinds the scenes instead of DBM. This means that key-value pairs can be edited without the file size increasing, eliminating bloat.

Installation: pip install picapica

Usage

Basic usage:

import pica

with pica.open("data.sqlite") as db:
    db["x"] = 1
    db["y"] = {"a": 42}

    print(db["x"])
    print("y" in db)
    print(len(db))

Unlike shelve, repeatedly updating key-value pairs does not necessarily increase the file size. However, the storage can still be optimised now and again! For this, use db.vacuum:

with pica.open("data.sqlite") as db:
  db.vacuum()

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

picapica-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

picapica-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file picapica-0.1.0.tar.gz.

File metadata

  • Download URL: picapica-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for picapica-0.1.0.tar.gz
Algorithm Hash digest
SHA256 544bc19886c7006e1651f87de871fef7c55ac03a38a367da3ef9aa4d8bc2424b
MD5 9e74d628c75b95d9bf15aed028bd5dbf
BLAKE2b-256 222470da0584bb74ddb8165b2b8a1733a43dccd7f095d50502433a86790e6a51

See more details on using hashes here.

File details

Details for the file picapica-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: picapica-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for picapica-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2d3afe365347fd83fccf33f8b041a387c88c55cbba537d077f4c832bfb3492a
MD5 80fc6f0787221e2f0f3dba2dcbbfa847
BLAKE2b-256 ac638c63c31d726bb763a6d33462147c8e365c0638e068f124da78f1634eb2cc

See more details on using hashes here.

Supported by

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