https://github.com/ittus/python-mixpanel3
An utility to work with mixpanel API and python 3
https://github.com/ittus/python-mixpanel3
Last synced: 3 months ago
JSON representation
An utility to work with mixpanel API and python 3
- Host: GitHub
- URL: https://github.com/ittus/python-mixpanel3
- Owner: ittus
- License: mit
- Created: 2016-03-20T10:00:04.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-20T10:17:41.000Z (almost 10 years ago)
- Last Synced: 2025-03-15T11:50:22.366Z (10 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
An utility library to work with Mixpanel API and python 3
# Installation
```
pip install mixpanel3
```
# Example
```
mixpanel = Mixpanel(api_key=API_KEY, api_secret=API_SECRET)
date_format = "%Y-%m-%d"
date_now = datetime.datetime.utcnow()
date_last_week = date_now - datetime.timedelta(days=7)
query_params = {
'event': EVENT_EXAMPLE,
'from_date': str(date_now.strftime(date_format)),
'to_date': str(date_now.strftime(date_format)),
'format': 'json',
'on': 'properties["' + PROPERTIES_FIELD_EXAMPLE + '"]',
}
response = mixpanel.get_request(methods='segmentation/numeric', params=query_params)
```
#REQUIRE LIBRARY
[Python Request](https://github.com/kennethreitz/requests)