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': '20140101',
'endDate': '20143001',
'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
=========
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': '20140101',
'endDate': '20143001',
'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
Release history Release notifications | RSS feed
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.1.tar.gz
(3.8 kB
view details)
File details
Details for the file pycriteo-0.0.1.tar.gz.
File metadata
- Download URL: pycriteo-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36f2fa9475621688f32e4a7d671712dc953f6eda2c1a91c28d8695728f5c28e0
|
|
| MD5 |
01dedd9593643119020e1ba9983f8a26
|
|
| BLAKE2b-256 |
946013ced63163fe58392ea0d1bfeb09ba57d984e7373a4d3a7b803f765f527b
|