Skip to main content

appendonly README

This package provides a set of data structures for use in ZODB applications where standard BTrees are poor fits for an application’s requirements.

In particular, these data structures are designed to minimize conflict errors when doing frequent “append” operations to queues and stacks.

appendonly.AppendStack

This class provides a LIFO stack of separately-persisted objects:

  • The stack manages a set of “layer” objects, with a configurable limit on the number of layers. Each layer has a configurable maximum length, and a sequential generation number.

  • The stack appends items to most recent layer until the layer is filled; it then adds a new layer.

  • If the number of layers then exceeds the configured maximum, the stack pruneds the oldest layer(s) to conform to that limit.

  • When pruning, the stack calls an application-supplied callback for archiving / cleanup of the pruned layer.

  • Iteration over the stack yields (generation, index, object) tuples. in reverse order to that in which the objects were appended.

The stack is implemented as a single persistent record, with custom ZODB conflict resolution code.

appendonly.Archive

This class provides a linked list of separately-persisted copies of layer data pruned from an AppendStack. The intended use would be something like:

from appendonly import AppendStack
from appendonly import Archive

class RecentItems(object):
    def __init__(self):
        self._recent = AppendStack()
        self._archive = Archive()

    def pushItem(object):
        self._stack.push(object, self._archive.addLayer)

    def __iter__(self):
        for generation, index, item in self._stack:
            yield item
        for generation, index, item in self._archive:
            yield items

appendonly.Accumulator

This class provides a list-like data structure, where the only mutations allowed are to append to or clear the list. Intended uses are for a set of pending operations / changes / notifications, which get processed as a unit (at which point the accumulator is cleared).

appendonly Changelog

1.2 (2014-12-28)

  • Add support for Python 3.4.

  • Make ZODB dependency unconditional, now that it fully supports Py3k.

  • Add support for testing on Travis.

1.1 (2013-11-28)

  • Add Accumulator.extend method to enhance list-ness.

  • Add support for PyPy.

  • Add support for Python 3.2 / 3.3.

1.0.1 (2013-02-25)

  • Fix brown-bag in 1.0 release (Accumulator.append changes were not persisted).

1.0 (2013-02-25)

  • Add a conflict-free ‘Accumulator’ class: manages a queue of items which can be iterated, appended to, or conumed entirely (no partial / pop).

  • Automate tests for supported Python versions via ‘tox’.

  • Drop support for Python 2.4 / 2.5.

0.10 (2012-02-21)

  • Add an ‘Archive’ class, intended to support long-term storage of the layer data pruned from an ‘AppendStack’.

0.9 (2010-08-09)

  • Initial public release.

Metadata

Release files for appendonly 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for appendonly 1.2
File Size Uploaded Provenance
appendonly-1.2.tar.gz 11.8 kB Without provenance Details

Release files / appendonly-1.2.tar.gz

Download URL appendonly-1.2.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
30e057e2ec8917491112fd32146695f82597de2f171ff4c1977d5ca604196a60
BLAKE2b-256 checksum
How to use checksums
3a43542e9ef723a09c1f11fe4f18bd4057bbdc2b117579125b936ebe271d23ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for appendonly 1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page