Skip to main content

Persistent transactional Python collections

Project description

tpcollections

Python Transactional Persistent Collections, backed by sqlite.

Descripton

This is a package that gives you a set of Python collections (Mappings, Lists, Sequence, and Deques) that are backed by SQLite. This allows you to

  • Share collections between threads or processes safely.
  • Maintain transactional safety across one or more collections.
  • Persist collections efficiently, safely, and easily to disk, across one or more file.
  • Manage collections that have expiring elements.

And do it all in any combination you wish without needing to worry about specific details.

Supported collection types

  • Mapping, ordered by key.
  • OrderedMapping, remembering insertion order.
  • Set, ordered by key.
  • OrderedSet, remembering insertion order.
  • ExpiringMapping, with key entries that automatically time out and remove themselves.
  • ExpiringOrderedMapping.
  • ExpiringSet.
  • ExpiringOrderedSet.
  • Sequence.
  • Deque.

There may be more in the future, if needed.

Features

  • Supports transactions, nestable through savepoints.
  • Supports intelligent WAL mode, making decisions automatically that achieve the maximum performance while preserving durability even in the face of power failure.
    • When not forced one way or the other, this means enabling WAL mode when no databases are attached, and disabling it upon attaching databases.
  • Supports many collections in one database file, ensuring all the used tables are the right type and that there are no collisions.
  • Supports multiple attached database files, maintaining transactions, consistency, and durability across the entire set.
  • Supports
  • Supported and tested on every reasonable version of Python and SQLite.
    • Tests are run all supported versions of Python, and on all in-support versions of RHEL, CentOS, Fedora, Debian, Ubuntu, and Alpine Linux.
      • This includes versions of Python or SQLite otherwise considered out of support by upstream. At the time of this writing, this includes CentOS 7 and therefore Python 3.6.8 and SQLite 3.7.17.
      • This does not include extended support (i.e. Centos 6 and Debian Jessie), because I haven't found a free and easy way to automate testing for them. I would be happy to accept contributions to add this support.
  • SQLite features are version-tested, selecting the most appropriate features available on the platform. This does mean that database files might not be able to be moved from a newer version of SQLite to an older one, particularly if you move from a version that supports STRICT and WITHOUT ROWID to one that doesn't

Prior art

TBC.

Feature comparison to other libraries

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

tpcollections-0.1.1.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

tpcollections-0.1.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tpcollections-0.1.1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for tpcollections-0.1.1.tar.gz
Algorithm Hash digest
SHA256 931023cfb6f08f49c5bac645387aef95fb4f90d99c7b8611bc9dc2dca530bac2
MD5 ace361806767033ea79ab33df33da73f
BLAKE2b-256 0c30b0bc846a3eed8b6fa145f4ce43e54b0efe454886e0e070fa8fbd66ce37db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tpcollections-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1dda12a3b5df3577ff175be8f671ce2542643e3ebf7e67ac20fffe1d370f225
MD5 0980a115f4e5dfecac4e601ebb6b11ef
BLAKE2b-256 dd2d7f3a026a4c211a1eddc6f4a5cc2a23949d3040cf5f278dde8bd50c62d973

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