numberly / appnexus-client

:snake: General purpose Python client for the AppNexus API
https://appnexus-client.readthedocs.io
MIT License
39 stars 19 forks source link

Reports Model and APIs to create and download it #22

Closed mevinbabuc closed 6 years ago

mevinbabuc commented 6 years ago
from appnexus import connect, Report

connect("username", "password", test=False)

json = {
    "report_type": "network_analytics",
    "columns": [
        "clicks",
        "total_convs",
        "insertion_order_id",
        "line_item_id",
    ],
    "report_interval": "lifetime",
    "format": "csv"
}

report_obj = Report(json).save()
data = report_obj.download()

# or this works too
# Can override the default retry count too.
# data = Report(json).save().download(retry_count=4)

PS: closed the previous PR as it was messy with lot of commits

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.3%) to 89.112% when pulling 6d5757f7650cd7bb7a68fa4cb23aaa9680a667f9 on mevinbabuc:reports into 2d988178014fe07e9c6026f290ba84d79e6703ba on numberly:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.1%) to 89.337% when pulling f6c7374afe6a9164979b7051187c7d89d155b95a on mevinbabuc:reports into 2d988178014fe07e9c6026f290ba84d79e6703ba on numberly:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.1%) to 89.337% when pulling f6c7374afe6a9164979b7051187c7d89d155b95a on mevinbabuc:reports into 2d988178014fe07e9c6026f290ba84d79e6703ba on numberly:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.1%) to 89.337% when pulling f6c7374afe6a9164979b7051187c7d89d155b95a on mevinbabuc:reports into 2d988178014fe07e9c6026f290ba84d79e6703ba on numberly:master.

ramnes commented 6 years ago

Thanks a lot for your contribution and great reactivity! If you feel like adding tests in another PR, that would be with great pleasure.