Name | piano-analytics-api JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | Python implementation for the Piano Anaytics Reporting API (formerly ‘At Internet’) |
upload_time | 2024-12-04 14:30:26 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
at internet
piano analytics
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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](https://www.python.org/downloads/) or higher.
## Installation ##
You can use **Pip** or **Download the Release**
### Pip
The preferred method is via [the Python package index](https://pypi.org/).
```sh
pip3 install piano-analytics-api
```
## Usage example
1. Create an API key in your [Piano Analytics account](https://analytics.piano.io/profile/#/apikeys).
2. Get the access key and secret key from the API key.
3. Find the site ID’s in [Piano Analytics access management](https://analytics.piano.io/access-management/#/sites).
Select a site on the page and copy the id from the address bar.
```python
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()}")
```
Raw data
{
"_id": null,
"home_page": null,
"name": "piano-analytics-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "at internet, piano analytics",
"author": null,
"author_email": "Remy Glaser <rglaser@gld.nl>",
"download_url": "https://files.pythonhosted.org/packages/18/05/a766d2e29c715b32f6eb2411b706817ff109fce280552a8161961136d488/piano_analytics_api-1.0.0.tar.gz",
"platform": null,
"description": "# Piano analytics (formerly \u2018AT Internet\u2019) Python client\n\nThis library enables you to get queries from the Piano Analytics Reporting API v3.\nThis is a third-party library.\nA subscription to Piano Analytics is required.\n\n## Requirements ##\n* [Python 3.9](https://www.python.org/downloads/) or higher.\n\n## Installation ##\n\nYou can use **Pip** or **Download the Release**\n\n### Pip\n\nThe preferred method is via [the Python package index](https://pypi.org/).\n\n```sh\npip3 install piano-analytics-api\n```\n\n## Usage example\n\n1. Create an API key in your [Piano Analytics account](https://analytics.piano.io/profile/#/apikeys).\n2. Get the access key and secret key from the API key.\n3. Find the site ID\u2019s in [Piano Analytics access management](https://analytics.piano.io/access-management/#/sites).\n Select a site on the page and copy the id from the address bar.\n\n```python\nimport piano_analytics_api.period as period\nimport piano_analytics_api.pfilter as pfilter\nfrom piano_analytics_api import Client, Request\n\nsite_id = 614694\naccess_key = \"\"\nsecret_key = \"\"\n\n# Create API connection\nclient = Client(access_key, secret_key)\n\n# Get page titles and number of visits for each page,\n# where the page title is not empty and domain is example.com,\n# ordered by the number of visits from high to low.\nrequest = Request(\n client=client,\n sites=[site_id],\n columns=[\"page\", \"m_visits\"],\n period=period.today(),\n sort=[\"-m_visits\"],\n property_filter=pfilter.ListAnd(\n pfilter.IsEmpty(\"page\", False),\n pfilter.Contains(\"domain\", [\"example.com\", \"www.example.com\"])\n )\n)\n\n# All results\ni = 0\nfor item in request.get_result_rows():\n print(item)\n i += 1\n\n# Number of results\nprint(f\"rowcount: {request.get_rowcount()}\")\n\n# Cumulative metrics for all resulting rows\nprint(f\"total: {request.get_total()}\")\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Python implementation for the Piano Anaytics Reporting API (formerly \u2018At Internet\u2019)",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/omroepgelderland/piano-analytics-python-api",
"Issues": "https://github.com/omroepgelderland/piano-analytics-python-api/issues",
"source_archive": "https://github.com/omroepgelderland/piano-analytics-python-api/archive/cabfc3b935dabdd2e150cb7444bae54600368907.zip"
},
"split_keywords": [
"at internet",
" piano analytics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0a4f38ccb86c7e492fe7869bf8fb0a7e33b95c0836d1b1e044f3b361a60ff81f",
"md5": "eea34a0ffcf269227c071c1dfd2a9ff4",
"sha256": "d8614ecfc2d3a59d6c91c7e53103b13e30accdb40d61df7cc6be837ba91163b0"
},
"downloads": -1,
"filename": "piano_analytics_api-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eea34a0ffcf269227c071c1dfd2a9ff4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 10498,
"upload_time": "2024-12-04T14:30:24",
"upload_time_iso_8601": "2024-12-04T14:30:24.491709Z",
"url": "https://files.pythonhosted.org/packages/0a/4f/38ccb86c7e492fe7869bf8fb0a7e33b95c0836d1b1e044f3b361a60ff81f/piano_analytics_api-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1805a766d2e29c715b32f6eb2411b706817ff109fce280552a8161961136d488",
"md5": "bbfcef11645f80778026a917f27e3613",
"sha256": "b92cbc885221e9e457dc77ff8f7ca74736c768a3e343fcf63c65936bf6b59f58"
},
"downloads": -1,
"filename": "piano_analytics_api-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "bbfcef11645f80778026a917f27e3613",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 10946,
"upload_time": "2024-12-04T14:30:26",
"upload_time_iso_8601": "2024-12-04T14:30:26.579687Z",
"url": "https://files.pythonhosted.org/packages/18/05/a766d2e29c715b32f6eb2411b706817ff109fce280552a8161961136d488/piano_analytics_api-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-04 14:30:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "omroepgelderland",
"github_project": "piano-analytics-python-api",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "piano-analytics-api"
}