# Path: datapackage_pipelines/wrapper/wrapper.py
# def ingest(debug=False):
#     params, datapackage, resource_iterator = _ingest(debug=debug)
#     return ProcessorContext(params, datapackage, resource_iterator)
# 
# Path: datapackage_pipelines/utilities/flow_utils.py
# def spew_flow(flow, ctx: ProcessorContext):
#     flow = Flow(
#         update_package(**ctx.datapackage),
#         load((ctx.datapackage, ctx.resource_iterator)),
#         flow,
#     )
#     datastream = flow.datastream()
#     ctx.datapackage = datastream.dp.descriptor
#     ctx.resource_iterator = datastream.res_iter
#     ctx.stats = MergeableStats(datastream.stats, ctx.stats)
# 
# Path: datapackage_pipelines/lib/update_package.py
# def flow(parameters):
#     return Flow(
#         update_package(**parameters)
#     )


import warnings
from datapackage_pipelines.wrapper import ingest
from datapackage_pipelines.utilities.flow_utils import spew_flow
from datapackage_pipelines.lib.update_package import flow




if __name__ == '__main__':
    warnings.warn(
        'add_metadata will be removed in the future, use "update_package" instead',
        DeprecationWarning
    )
    with ingest() as ctx:

# Path: datapackage_pipelines/wrapper/wrapper.py
# def ingest(debug=False):
#     params, datapackage, resource_iterator = _ingest(debug=debug)
#     return ProcessorContext(params, datapackage, resource_iterator)
# 
# Path: datapackage_pipelines/utilities/flow_utils.py
# def spew_flow(flow, ctx: ProcessorContext):
#     flow = Flow(
#         update_package(**ctx.datapackage),
#         load((ctx.datapackage, ctx.resource_iterator)),
#         flow,
#     )
#     datastream = flow.datastream()
#     ctx.datapackage = datastream.dp.descriptor
#     ctx.resource_iterator = datastream.res_iter
#     ctx.stats = MergeableStats(datastream.stats, ctx.stats)
# 
# Path: datapackage_pipelines/lib/update_package.py
# def flow(parameters):
#     return Flow(
#         update_package(**parameters)
#     )


# Path: datapackage_pipelines/lib/add_metadata.py
import warnings
from datapackage_pipelines.wrapper import ingest
from datapackage_pipelines.utilities.flow_utils import spew_flow
from datapackage_pipelines.lib.update_package import flow





if __name__ == '__main__':
    warnings.warn(
        'add_metadata will be removed in the future, use "update_package" instead',
        DeprecationWarning
    )
    with ingest() as ctx:

        spew_flow(flow(ctx.parameters), ctx)