from into import into, convert, append, CSV path = convert.path(CSV, set) for source, target, func in path: print '%25s -> %-25s via %s()' % (source.__name__, target.__name__, func.__name__) # Given type: Convert source to new object into(list, (1, 2, 3)) # Given object: Append source to that object L = [1, 2, 3] into(L, (4, 5, 6)) L from into import convert, append convert(list, (1, 2, 3)) L = [1, 2, 3] append(L, (4, 5, 6)) import numpy as np import pandas as pd # target type, source data, cost @convert.register(np.ndarray, pd.DataFrame, cost=1.0) def dataframe_to_numpy(df, **kwargs): return df.to_records(index=False)