Skip to main content

RTB House SDK

Project description

Overview

This library provides an easy-to-use Python interface to RTB House API. It allows you to read and manage you campaigns settings, browse offers, download statistics etc.

Installation

RTB House SDK can be installed with pip:

$ pip install rtbhouse_sdk

Usage example

Let’s write a script which fetches campaign stats (imps, clicks, postclicks) and shows the result as a table (using tabulate library).

First, create config.py file with your credentials:

USERNAME = 'jdoe'
PASSWORD = 'abcd1234'

Set up virtualenv and install requirements:

$ pip install rtbhouse_sdk tabulate
from operator import itemgetter

from tabulate import tabulate

from config import USERNAME, PASSWORD
from rtbhouse_sdk.reports_api import ReportsApiSession

if __name__ == '__main__':
    api = ReportsApiSession(USERNAME, PASSWORD)
    advertisers = api.get_advertisers()
    stats = api.get_campaign_stats_total(advertisers[0]['hash'], '2017-10-01', '2017-10-31', ['day'])
    columns = ['day', 'impsCount', 'clicksCount', 'ctr', 'campaignCost', 'conversionsCount', 'conversionsRate', 'cpc', 'ecc', 'roas', 'conversionsValue']
    data_frame = [[row[c] for c in columns] for row in reversed(sorted(stats, key=itemgetter('day')))]
    print(tabulate(data_frame, headers=columns))

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtbhouse_sdk-3.3.4.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file rtbhouse_sdk-3.3.4.tar.gz.

File metadata

  • Download URL: rtbhouse_sdk-3.3.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for rtbhouse_sdk-3.3.4.tar.gz
Algorithm Hash digest
SHA256 687e3f986afd02d2e1572b4d59d51e28eb72878c24e1b6e5444573664dc25e28
MD5 407ac17e244bc5767e357160823246de
BLAKE2b-256 b5c7aff36b9431c90e58352e5b68da97e8d6dea0bd74d797947032f287fe3c2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page