import inspect


def get_source_info(obj):
    """ returns {'line': ..., 'path': ..., 'source': ...} containing information about an object's source """
    path = inspect.getsourcefile(obj)
    lines, line = inspect.getsourcelines(obj)

    # make it 0-indexed
    if line > 0:
        line -= 1

    return {'path': path, 'source': lines, 'line': line}