Sorted Containers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. faced with a dozen different implementations, you will require sorted containers.
SortedContainers takes all of the work out of Python sorted types - making your deployment and use of Python easy. There’s no need to install a C compiler or pre-build and distribute custom extensions. Performance is a feature and testing has 100% coverage with unit tests and hours of stress.