Skip to main content

Garf implementation for Google Analytics API

Project description

garf for Google Analytics API

PyPI Downloads PyPI

garf-google-analytics simplifies fetching data from Google Analytics API using SQL-like queries.

Prerequisites

Installation

pip install garf-google-analytics

Usage

Run as a library

import garf_google_analytics
from garf_io import writer

# Fetch report
fetched_report = (
  garf_google_analytics.GoogleAnalyticsApiReportFetcher()
  .fetch(query, query="<YOUR_QUERY_HERE">, property_id=PROPERTY_ID)
)

# Write report to console
console_writer = writer.create_writer('console')
console_writer.write(fetched_report, 'output')

Run via CLI

Install garf-executors package to run queries via CLI (pip install garf-executors).

garf <PATH_TO_QUERIES> --source google-analytics \
  --output <OUTPUT_TYPE> \
  --source.<SOURCE_PARAMETER=VALUE>

where:

  • <PATH_TO_QUERIES> - local or remove files containing queries
  • <OUTPUT_TYPE> - output supported by garf-io library.
  • <SOURCE_PARAMETER=VALUE - key-value pairs to refine fetching, check available source parameters.

Available source parameters

name values comments
property_id Property to get data to Multiple properties are supported, should be comma-separated

Project details


Download files

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

Source Distribution

garf_google_analytics-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garf_google_analytics-0.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file garf_google_analytics-0.0.1.tar.gz.

File metadata

File hashes

Hashes for garf_google_analytics-0.0.1.tar.gz
Algorithm Hash digest
SHA256 67cb8f621d17d3511437f9c2c7287b1a8c88d2309063742a007a8585feaaa5a2
MD5 e065e47c126ce41763ed66200e130acd
BLAKE2b-256 3cfb761c0a91f600d4df32f7057b82ac17e9113c7c376c2e1c1adbd869f769b9

See more details on using hashes here.

File details

Details for the file garf_google_analytics-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for garf_google_analytics-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5859159df71cc129bd8264da409c8fa6993e59a4596e661f392b9ca8a5dfe0f9
MD5 df780aadcd7a50bf52c17a09c569731c
BLAKE2b-256 dbaa525fbb27affc0331303ae33105b080d28eb75285c45ec193b6cf9dbacf7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page