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.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tpcollections-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 1e98799987799792259424e7faa8249f12d28cbdd23b3ff58d69f5676d7b08d3
MD5 d9518d4402be4c969f4eafb1a57b39d1
BLAKE2b-256 c6c336515e9865f1e6f806b55517bb7db621987478535c770031a62815adbb0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tpcollections-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d886cce60e4301492f57a7f0ca7123236ac8c758d582beca6c577403bc0d037
MD5 363f3e76cd369a04e5854b3b662ba988
BLAKE2b-256 fd7dfbdb72906f002830d91d45d4c6d9ef0a37265839eafe98edb7b0814b623a

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