Skip to main content

Garf implementation for Google Ads API

Project description

garf for Google Ads API

PyPI Downloads PyPI

garf-google-ads simplifies fetching data from Google Ads API using SQL-like queries.

Prerequisites

Installation

pip install garf-google-ads

Usage

Run as a library

import os

from garf_io import writer
from garf_google_ads import GoogleAdsApiReportFetcher

query = """
SELECT
  campaign.id,
  metrics.clicks AS clicks
FROM campaign
WHERE segments.date DURING LAST_7_DAYS
"""

fetched_report = (
  GoogleAdsApiReportFetcher(
    path_to_config=os.getenv('GOOGLE_ADS_CONFIGURATION_FILE_PATH')
  )
  .fetch(query, account=os.getenv('GOOGLE_ADS_ACCOUNT'))
)

console_writer = writer.create_writer('console')
console_writer.write(fetched_report, 'query')

Run via CLI

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

garf <PATH_TO_QUERIES> --source google-ads \
  --output <OUTPUT_TYPE> \
  --source.account=GOOGLE_ADS_ACCOUNT \
  --source.path-to-config=./google-ads.yaml

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
account Account(s) to get data from Can be MCC(s) as well
path-to-config Path to google-ads.yaml file ~/google-ads.yaml is a default location
expand-mcc Whether to force account expansion if MCC is provided False by default
customer-ids-query Optional query to find account satisfying specific condition
version Version of Google Ads API

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_ads-0.0.4.tar.gz (10.5 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_ads-0.0.4-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file garf_google_ads-0.0.4.tar.gz.

File metadata

  • Download URL: garf_google_ads-0.0.4.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for garf_google_ads-0.0.4.tar.gz
Algorithm Hash digest
SHA256 55d53c71f67a4d86de67515d82cf37672c6f0919b63ca887a1ccf00f3e0a266a
MD5 6ab4ba037028a34e94611b99460a9586
BLAKE2b-256 3f89093f1f717b0f0db5448bfb7b11ae809303cbcb296363695895ac4a7711a2

See more details on using hashes here.

File details

Details for the file garf_google_ads-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: garf_google_ads-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for garf_google_ads-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7c4cec39cf35942e23af9027e4486a9d7f044a637670e51058b3e74d2cef1e92
MD5 a7bc73320735eacefd11d3d800baf1eb
BLAKE2b-256 67fedc4cf8292604945c66d43da1025d2f1e3b6ff0399870f811bc670d130a1e

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