backend reporting via a worker/queue system
Project description
event-reporter
===========================
A Python wrapper for backend reporting via a worker/queue system.
[![travis](https://travis-ci.com/e271828-/event-reporter.svg?branch=master)](https://travis-ci.com/e271828-/event-reporter)
[![Codecov](http://codecov.io/github/e271828-/event-reporter/coverage.svg?branch=master)](http://codecov.io/github/e271828-/event-reporter?branch=master)
System flow:
Store event quickly on webserver [e.g. within a flask endpoint]:
```
from event_reporter import EventReporter
from redis import StrictRedis
er = EventReporter(conn=StrictRedis())
er.store('ga', 'event', '<uuid4 clientid>', category='event_category', action='action_name', aip='1', uip='1.2.3.4', ds='web')
```
Fetch event within worker and dispatch to final destination:
```
from event_reporter import EventReporter
from redis import StrictRedis
er = EventReporter(conn=StrictRedis())
r = er.fetch()
er.dispatch(r)
```
## Env vars used
`EVENTREPORTER_QUEUE_NAME` (redis key)
`UA_ID` (GA UA ID)
`EVENTREPORTER_TTL` (int: controls whether to set expire time for redis keys)
## Testing
```
export UA_ID='My_UA_ID'
nosetests -s
```
.. and check your GA property to see the data.
===========================
A Python wrapper for backend reporting via a worker/queue system.
[![travis](https://travis-ci.com/e271828-/event-reporter.svg?branch=master)](https://travis-ci.com/e271828-/event-reporter)
[![Codecov](http://codecov.io/github/e271828-/event-reporter/coverage.svg?branch=master)](http://codecov.io/github/e271828-/event-reporter?branch=master)
System flow:
Store event quickly on webserver [e.g. within a flask endpoint]:
```
from event_reporter import EventReporter
from redis import StrictRedis
er = EventReporter(conn=StrictRedis())
er.store('ga', 'event', '<uuid4 clientid>', category='event_category', action='action_name', aip='1', uip='1.2.3.4', ds='web')
```
Fetch event within worker and dispatch to final destination:
```
from event_reporter import EventReporter
from redis import StrictRedis
er = EventReporter(conn=StrictRedis())
r = er.fetch()
er.dispatch(r)
```
## Env vars used
`EVENTREPORTER_QUEUE_NAME` (redis key)
`UA_ID` (GA UA ID)
`EVENTREPORTER_TTL` (int: controls whether to set expire time for redis keys)
## Testing
```
export UA_ID='My_UA_ID'
nosetests -s
```
.. and check your GA property to see the data.
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
Close
Hashes for event-reporter-1.0.7.macosx-10.14-intel.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa9547ccf7503cb61c03ce2ff4d9ba5c2d65e0b1015f45e0ffeb2f9e22d0cdcf |
|
MD5 | caefc189484283db70cb5d77f1693c4d |
|
BLAKE2b-256 | 83dd99c2925c52b4edcf78625f8a2a8703b599cd3f14bbf60b5de1a8ff52a834 |