trash-cli is a command line interface to the FreeDesktop.org trashcan. It implements the FreeDesktop.org trash specification. For each trashed file, it will remember the name, original path, date of deletion, and permissions. It interoperates with KDE and GNOME Trash, and is CLI compatible with the rm command.
treap.py is a treap implementation for Python. A treap is a hybrid of a binary tree and a binary heap that is self-balancing and is O(nlog2(n)) for most operations, including deleting a value, inserting a value, finding the least value, and finding the greatest value. This particular treap implementation looks like a dictionary to the caller, but it also supports getting an ordered list (forward or reverse) in O(n) time. The code is available as pure Python (should run on about any Python implementation supporting generators, but was tested on CPython 2.6) or as part Python and part Cython for performance. The version with Cython should run on CPython or Unladen Swallow, but was only tested on CPython 2.6.