Garf implementation for Google Campaign Manager 360 API
Project description
garf for Campaign Manager 360 API
garf-campaign-manager simplifies fetching data from Campaign Manager 360 API using SQL-like queries.
Prerequisites
- Campaign Manager 360 API enabled.
- Credentials configured.
Installation
pip install garf-campaign-manager
Usage
Run as a library
from garf.community.google.campaign_manager import CampaignManager360ApiReportFetcher
from garf.io import writer
# Fetch report
query = """
SELECT
dimensions.advertiser AS advertiser,
advertiserId AS advertiser_id,
metric.clicks AS clicks
FROM standard
WHERE
dateRange IN (2025-01-01, 2025-12-31)
"""
fetched_report = CampaignManager360ApiReportFetcher(profile_id=<PROFILE_ID>).fetch(query, title='sample_query')
# Write report to console
console_writer = writer.create_writer('console')
console_writer.write(fetched_report, 'output')
Run via CLI
Install
garf-executorspackage to run queries via CLI (pip install garf-executors).
garf <PATH_TO_QUERIES> --source campaign-manager \
--output <OUTPUT_TYPE> \
--source.<SOURCE_PARAMETER=VALUE>
where:
<PATH_TO_QUERIES>- local or remove files containing queriesoutput- output supported bygarf-iolibrary.<SOURCE_PARAMETER=VALUE- key-value pairs to refine fetching, check available source parameters.
Available source parameters
| name | values | comments |
|---|---|---|
profile_id |
Id of CM360 profile | |
credentials_file |
File with Oauth or service account credentials | You can expose credentials_file as GARF_CAMPAIGN_MANAGER_360_CREDENTIALS_FILE ENV variable |
auth_mode |
Type of authentication: oauth or service_account |
oauth is the default mode |
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
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_campaign_manager-0.0.2.tar.gz.
File metadata
- Download URL: garf_campaign_manager-0.0.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f43dc829bbc4b99c7566db8a9a196229b6b2a11532f04c0da50757be7f921f8
|
|
| MD5 |
d7fe4aa22a2ee130483c02466abf2577
|
|
| BLAKE2b-256 |
e2fa0e2c8d2db0de2fbacc0dbdf44db104102a6af0008531aeb2aec88ebf73e8
|
File details
Details for the file garf_campaign_manager-0.0.2-py3-none-any.whl.
File metadata
- Download URL: garf_campaign_manager-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
433e005109fabe9dc692ab8d1040156377330369b46882abecd28d6806812cf1
|
|
| MD5 |
23560dffdaeab098ef7be10a9a973686
|
|
| BLAKE2b-256 |
8b484faa9c04be2556d50bfafdcf25f8a7cf07d83415f2188a3de815bd4c34b7
|