# RedBlackPy

#### Fast and scalable data structures for scientific and quantitative research in Python

RedBlackPy is a light Python library that provides data structures aimed to fast insertion, removal and self sorting to manipulating ordered data in efficient way. The core part of the library had been written on C++ and then was wrapped in Cython. Hope that many would find the primary data structures of this library very handy in working with time series. One of the main feature of this structures is an access by arbitrary key using interpolation, what makes processing of multiple non synchronized time series very simple. All data structures based on red black trees.

### Installation

##### 1. Build and install from source

>> python setup.py install
##### 2. Via pip

>> pip install redblackpy

### Package content

The first release is presented by two classes: Series and SeriesIterator. See documnetation and user guide for usage.

### Cython Users

We have include pxd files for Cython users. See source. To use Series class from Cython input the following imports in yours .pyx files:

# your_ex.pyx

from redblackpy.series.tree_series import Series
from redblackpy.series.tree_series cimport Series

cpdef Series test():
cdef Series myseries = Series()

myseries.insert(1,1)

return myseries

Also, include necessary directories with .hpp headers to compile your extension module by adding include_dirs parameter in Extension object:

# setup.py

from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import redblackpy as rb

ex = Extension( "your_module.your_ex",
sources=["your_module/your_ex.pyx"],
include_dirs=[rb.get_include()] )

setup( name='your_module',
ext_modules = cythonize(ex) )