Garf implementation for Google Merchant API
Project description
garf for Merchant API
garf-merchant-api simplifies fetching data from Merchant API using SQL-like queries.
Prerequisites
- Merchant API enabled.
Installation
pip install garf-merchant-api
Usage
Run as a library
from garf_merchant_api import report_fetcher
from garf_io import writer
# Specify query
query = """
SELECT
date,
clicks
FROM product_performance_view
WHERE date BETWEEN '2023-12-01' AND '2023-12-03'
ORDER BY clicks DESC
""
# Fetch report
fetched_report = (
report_fetcher.MerchantApiReportFetcher()
.fetch(query, query="<YOUR_SEARCH_QUERY_HERE">, account=ACCOUNT_ID)
)
# 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 merchant-api \
--output <OUTPUT_TYPE> \
--source.<SOURCE_PARAMETER=VALUE>
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 to | Multiple accounts are supported, should be comma-separated |
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_merchant_api-0.0.1.tar.gz.
File metadata
- Download URL: garf_merchant_api-0.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83311dfd082b04784c810280486c715637eeec1decdeeebd682213f6238a97ba
|
|
| MD5 |
0dd82cc6e799fbdb8a3719fcdd95cabb
|
|
| BLAKE2b-256 |
24530632e9da349083cc447cd317612f0230771c1112539a4232bf7abf6cbccb
|
File details
Details for the file garf_merchant_api-0.0.1-py3-none-any.whl.
File metadata
- Download URL: garf_merchant_api-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8487f0b25b9f532eb4a474dd8034d2a36e98bc4f6d526b1a5d97cc40fb2ef39d
|
|
| MD5 |
e90504a531b81ce514aba44017cea21e
|
|
| BLAKE2b-256 |
2a397809e80e8aaa942539790aea040d54017e6e22b41d51da97092bd47e8c02
|