Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install appendonly

How to install appendonly

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install appendonly
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.10
1.0.1Never BuiltWhy not?
0.10 Available View build log
0.9 Available View build log
Windows (64-bit)
0.10
1.0.1Never BuiltWhy not?
0.10 Available View build log
0.9 Available View build log
Mac OS X (10.5+)
0.10
1.0.1Never BuiltWhy not?
0.10 Available View build log
0.9 Available View build log
Linux (32-bit)
1.0.1 Available View build log
0.10 Available View build log
0.9 Available View build log
Linux (64-bit)
1.0.1 Available View build log
0.10 Available View build log
0.9 Available View build log
 
License
ZPL
Dependencies
Imports
Lastest release
version 1.0.1 on Mar 1st, 2013

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 Changelog

1.0.1 (2013-02-25)
  • Fix brown-bag in 1.0 release ('Accumulator.append' changes were not persisted).
1.0 (2013-02-25)
  • Added a conflict-free 'Accumulator' class: manages a queue of items which can be iterated, appended to, or conumed entirely (no partial / pop).
  • Automated tests for supported Python versions via 'tox'.
  • Dropped support for Python 2.4 / 2.5.
0.10 (2012-02-21)
  • Added 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.

Subscribe to package updates

Last updated Mar 1st, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.