Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eltorocorp/eltoro-stats-to-csv
A helper/example script to consume the El Toro API for Stats
https://github.com/eltorocorp/eltoro-stats-to-csv
analyticsmlteam csv portal reporting stats
Last synced: 9 days ago
JSON representation
A helper/example script to consume the El Toro API for Stats
- Host: GitHub
- URL: https://github.com/eltorocorp/eltoro-stats-to-csv
- Owner: eltorocorp
- Created: 2016-09-22T17:12:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-30T16:12:38.000Z (about 7 years ago)
- Last Synced: 2024-11-22T09:28:23.644Z (2 months ago)
- Topics: analyticsmlteam, csv, portal, reporting, stats
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 47
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stats-to-csv
## Overview
Produces a csv summary of click and impression stats from the Eltoro Portal for Stats for running campaigns.
This is only functional if you are a customer of Eltoro, and wanting daily
dumps of stats in CSV format, but it should give you a base to work with for
any reporting functional desired from our portal.## Usage
```
python stats2csv
```start and end should be provided in the `%Y-%m-%d` or `%Y-%m-%d %H:%M:%S` format
If the dates or time_frame is left off, it defaults to yesterday's date with
time_frame of hour.### Example
```
python stats2csv myusername mypassword 2016-01-01 2016-01-31 day
```### Scheduling Usage
Scheduling this task to be run as a daily `cron` would be quite simple,
just make sure it is run with *yesterday's* date range, since *today* would not be complete.## Windows Usage
Run the included windows bat script as a scheduled task. Be sure to edit the
last lines and add your username/password, and make sure the server has python
installed - link is in the batch script.## Initial Setup
The first time you set this up on **windows**, you need to run the `setup.bat` script.
This will install the requests module for python.
In a **linux or OSX** environment, you need to also have the requests module.
Just run `sudo pip install requests` in addition to python2.x installed.
## Extending / Next Steps
* You could setup this script as a cron or scheduled task
* You could automatically FTP or POST or import the CSV within your network
* If you do not want to build a CSV from your stats, just use the API response directly *(an array of objects)*
* You can query for a single `campaignId`, `orderLineId`, or `creativeId` and get more specific stats
* If you are doing more than quering stats, use this as a basic guide for API interactions and build your own tool