Piano analytics (formerly ‘AT Internet’) Python client
This library enables you to get queries from the Piano Analytics Reporting API v3. This is a third-party library. A subscription to Piano Analytics is required.
Requirements
- Python 3.9 or higher.
Installation
You can use Pip or Download the Release
Pip
The preferred method is via the Python package index.
pip3 install piano-analytics-api
Usage example
- Create an API key in your Piano Analytics account.
- Get the access key and secret key from the API key.
- Find the site ID’s in Piano Analytics access management. Select a site on the page and copy the id from the address bar.
import piano_analytics_api.period as period
import piano_analytics_api.pfilter as pfilter
from piano_analytics_api import Client, Request
site_id = 614694
access_key = ""
secret_key = ""
# Create API connection
client = Client(access_key, secret_key)
# Get page titles and number of visits for each page,
# where the page title is not empty and domain is example.com,
# ordered by the number of visits from high to low.
request = Request(
client=client,
sites=[site_id],
columns=["page", "m_visits"],
period=period.today(),
sort=["-m_visits"],
property_filter=pfilter.ListAnd(
pfilter.IsEmpty("page", False),
pfilter.Contains("domain", ["example.com", "www.example.com"])
)
)
# All results
i = 0
for item in request.get_result_rows():
print(item)
i += 1
# Number of results
print(f"rowcount: {request.get_rowcount()}")
# Cumulative metrics for all resulting rows
print(f"total: {request.get_total()}")
Metadata
Release files for piano-analytics-api 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| piano_analytics_api-1.0.0.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| piano_analytics_api-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.4 kB
Release files / piano_analytics_api-1.0.0.tar.gz
| Download URL | piano_analytics_api-1.0.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b92cbc885221e9e457dc77ff8f7ca74736c768a3e343fcf63c65936bf6b59f58
|
|
BLAKE2b-256 checksum How to use checksums |
1805a766d2e29c715b32f6eb2411b706817ff109fce280552a8161961136d488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / piano_analytics_api-1.0.0-py3-none-any.whl
| Download URL | piano_analytics_api-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8614ecfc2d3a59d6c91c7e53103b13e30accdb40d61df7cc6be837ba91163b0
|
|
BLAKE2b-256 checksum How to use checksums |
0a4f38ccb86c7e492fe7869bf8fb0a7e33b95c0836d1b1e044f3b361a60ff81f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|