Skip to main content

Simple library to access the Criteo API

Project description

PyCriteo
=========

PyCriteo is a simple Python library to access the Criteo API.
It uses Python convenient built in dictionaries to make API requests.

Basic usage:
-----------
Get all running campaigns

>>> from pycriteo import Client
>>> c = Client('username', 'password', 'token')
>>> campaigns = c.getCampaigns({'campaignStatus': 'RUNNING'})
>>> dict(campaigns.campaign[0]).keys()
['status',
'campaignID',
'categoryBids',
'budgetID',
'campaignName',
'remainingDays',
'campaignBid']

Schedule a report job

>>> job = c.scheduleReportJob(
{'reportType': 'Category',
'reportSelector': {
'CampaignIDs': [i.campaignID for i in campaigns.campaign]},
'startDate': '2014-01-01',
'endDate': '2014-30-01',
'isResultGzipped': False,
'aggregationType': 'Daily'
}
)

Save the report job as csv

>>> c.downloadReport(job.jobID, 'my_report.csv')

Installation
--------------


pip install pycriteo


License
----

Apache 2.0

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

pycriteo-0.0.2.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file pycriteo-0.0.2.tar.gz.

File metadata

  • Download URL: pycriteo-0.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pycriteo-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5a3c7555ff6b5cc8e448fe0894dce6866bb0b79734cfd1a62495535bf133498d
MD5 a135a4ae4e64e35a43998acfaa005436
BLAKE2b-256 3e3b02a2124041253cc5ddb5773ece4c24591d790a446ca9dcdce7bad7d76f6b

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