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

from garf.community.google.analytics import GoogleAnalyticsApiReportFetcher
from garf.io import writer

# Fetch report
fetched_report = (
  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-1.0.0.tar.gz (5.2 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-1.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for garf_google_analytics-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0b56cf93885df2b44ecf379f344a8682b1330309e335d9561a94377aeb22fd42
MD5 385685baf8150e263dc5410a38aefd43
BLAKE2b-256 02e40476c7aaaa6ba940d223c5f278aaa3ba75b6ff7b38795f0bda2c120edf20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for garf_google_analytics-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a571bdc586016b0acf673dec7914814f5976bb0efb4c2d14e0b98846cf4ee863
MD5 f1cc10cb538e5512be68ca011618d447
BLAKE2b-256 12cef96c86ff4de667206e32750f4a33ebede3825bce82c83355b0cc8651775d

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