Skip to main content

A tiny persistent key–value store built on SQLite.

Project description

Pica: Persistent key-value storage

alt text

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.1.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.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: picapica-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b8a0ebafe2c01bd52057c33a383aecb7712e80c6d5b56546ab650d78a2c13650
MD5 f08365a1ef0a74519014e55091d2e273
BLAKE2b-256 6628d337648e8080153bac984be4fe2a3cab8d697ad80b2d1b6bd49d4a024be7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: picapica-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29e9e7e0ce3e19ac0b2c5b5177e71e858dad1b5a5585f6177cdab659c941ee62
MD5 fe3b0724756b39e02904b7da74d2adfd
BLAKE2b-256 9e416945a7c4ec457d0e8a7d06ad4145ff105dd1703712f52ffdc8b026d347b8

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