Skip to main content

A Python wrapper for the Matomo HTTP reporting API.

Project description

PMMatomo

A Python wrapper for the Matomo HTTP reporting API.

Run the test suite

python3 -m unittest

Installation

pip3 install PMMatomo

Usage

import datetime
from PMMatomo import Matomo, MatomoReportPeriod

m = Matomo(url=YOUR_MATOMO_API_URL,
           token=YOUR_MATOMO_AUTHENTICATION_TOKEN,
           siteId=YOUR_SITE_ID)


m.enableFilterLimit(False)
m.setReportPeriod(MatomoReportPeriod.month)

# since we set the report period to .month we get a report of the mont that this date is in
date = datetime.datetime.strptime("2019-01-26", '%Y-%m-%d')
m.setReportDateFromDatetime(date)


visitorDetails = m.genReportLiveGetLastVisistsDetails()
print(visitorDetails)

Upload to PIP

python3 -m venv venv
source venv/bin/activate
pip3 install twine
python3 setup.py sdist
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PMMatomo, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size PMMatomo-0.0.5.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page