This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

AnderssonTree Package


This package provides Andersson Tree implementation written in pure Python.

Sources of Algorithms

Some concepts are inspired by bintrees package at, although this implementation does not support dict, heap, set compatibility.


  • AnderssonTree() -> new empty tree;
  • AnderssonTree(mapping) -> new tree initialized from a mapping (requires only an items() method)
  • AnderssonTree(seq) -> new tree initialized from seq [(k1, v1), (k2, v2), … (kn, vn)]


  • __contains__(k) -> True if T has a key k, else False
  • __delitem__(y) <==> del T[y]
  • __getitem__(y) <==> T[y]
  • __iter__() <==> iter(T) <==> keys()
  • __len__() <==> len(T)
  • __repr__() <==> repr(T)
  • __reversed__() <==> reversed(T), reversed keys
  • __setitem__(k, v) <==> T[k] = v
  • __copy__() <==> copy()
  • clear() -> None, remove all items from T
  • copy() -> a shallow copy of T, tree structure, i.e. key insertion order is preserved
  • dump([order]) -> None, dumps tree according to order
  • get(k) -> T[k] if k in T, else None
  • insert(k, v) -> None, insert node with key k and value v, replace value if key exists
  • is_empty() -> True if len(T) == 0
  • iter_items([, reverse]) -> generator for (k, v) items of T
  • keys([reverse]) -> generator for keys of T
  • remove(key) -> None, remove item by key
  • remove_items(keys) -> None, remove items by keys
  • root() -> root node
  • traverse(f, [order]) -> visit all nodes of tree according to order and call f(node) for each node
  • update(E) -> None. Update T from dict/iterable E
  • values([reverse]) -> generator for values of T

Order values

  • ORDER_INFIX_LEFT_RIGHT - infix order, left child first, then right
  • ORDER_INFIX_RIGHT_LEFT - infix order, right child first, then left
  • ORDER_PREFIX_LEFT_RIGHT - prefix order, left child first, then right
  • ORDER_PREFIX_RIGHT_LEFT - prefix order, right child first, then left
  • ORDER_POSTFIX_LEFT_RIGHT - postfix order, left child first, then right
  • ORDER_POSTFIX_RIGHT_LEFT - postfix order, right child first, then left


from source:

python install

or from PyPI:

pip install anderssontree


this README.rst, code itself, docstrings

anderssontree can be found on at:

Tested With

Python2.7.5, Python3.3.2

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
anderssontree-0.1.0-py2.7.egg (12.0 kB) Copy SHA256 Checksum SHA256 2.7 Egg Oct 18, 2013
anderssontree-0.1.0-py3.3.egg (12.5 kB) Copy SHA256 Checksum SHA256 3.3 Egg Oct 18, 2013
anderssontree-0.1.0.tar.gz (7.6 kB) Copy SHA256 Checksum SHA256 Source Oct 18, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting