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.community.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:

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-1.0.2.tar.gz (13.0 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-1.0.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: garf_google_ads-1.0.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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-1.0.2.tar.gz
Algorithm Hash digest
SHA256 68018399da8d2072be56fa13b719567186309de9971bf384b7e88971ce77819b
MD5 82c1366e9a751d252941af489addbcdf
BLAKE2b-256 69b3f395e61669f4784d775a95c5595695caa97e35fa04d47b332526152edf3a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: garf_google_ads-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","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-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1ecb55cbda7f11c5542fa41c637fb0ab1d88df6beba164eb29005b7837025c60
MD5 6efeb7f444c42135b2d69445447c20ab
BLAKE2b-256 ed7060d9be28e505835b87910954e367523a647d80ccefb2f05c5612b7a22d5f

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