Garf implementation for Google Ads API
Project description
garf for Google Ads API
garf-google-ads simplifies fetching data from Google Ads API using SQL-like queries.
Prerequisites
- Google Ads API enabled.
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-executorspackage 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 bygarf-iolibrary.<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
Release history Release notifications | RSS feed
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.3.tar.gz
(10.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file garf_google_ads-0.0.3.tar.gz.
File metadata
- Download URL: garf_google_ads-0.0.3.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92081479b584ea80f55b03029ba7d52774e4fd7b252840b5f6133d1092a62db3
|
|
| MD5 |
b1a1df075174aa104ad1388a4518bd36
|
|
| BLAKE2b-256 |
dc51a4c99cef8c33d2bd9e567e4fed6f1528bce5efb9ff0338957fba5c572fd2
|
File details
Details for the file garf_google_ads-0.0.3-py3-none-any.whl.
File metadata
- Download URL: garf_google_ads-0.0.3-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e3ff36753e8e122ff8e6222df0db21159fa597011bc2bcd167ca08204be53a3
|
|
| MD5 |
c6ab991ce30fe94c98fca60e6a98f1d4
|
|
| BLAKE2b-256 |
777105df7215ccf19f0d19644cf2db373713f5f5bc3510952f8030583d3220a0
|