Skip to main content

garf for Merchant API

PyPI Downloads PyPI

garf-merchant-api simplifies fetching data from Merchant API using SQL-like queries.

Prerequisites

Installation

pip install garf-merchant-api

Usage

Run as a library

from garf.community.google.merchant 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-executors package 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 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 to Multiple accounts are supported, should be comma-separated

Metadata

Release files for garf-merchant-api 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for garf-merchant-api 1.0.0
File Size Uploaded Provenance Actions
garf_merchant_api-1.0.0.tar.gz 4.1 kB Without provenance Details for garf_merchant_api-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for garf-merchant-api 1.0.0
File Interpreter ABI Platform Actions
garf_merchant_api-1.0.0-py3-none-any.whl Python 3 none any Details for garf_merchant_api-1.0.0-py3-none-any.whl

Total release size: 10.8 kB

Release files / garf_merchant_api-1.0.0.tar.gz

Download URL garf_merchant_api-1.0.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
43776595ffd2c6e052bd246750f032b1b59ffa93bb419071b17431042b2c477d
BLAKE2b-256 checksum
How to use checksums
b2ee6ad40870ce856db8ddd944668cc4f05ea4f6e1816b6195419d90455033c6
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / garf_merchant_api-1.0.0-py3-none-any.whl

Download URL garf_merchant_api-1.0.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b8c784b611297a639ddc2b4ca333e4957e4b856de3975f50a1e21daaa5eb050
BLAKE2b-256 checksum
How to use checksums
56d4fcb43b17e0fcf32bfb3719b2da50da2b2cf8fac709824d52383f917679f1
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for garf-merchant-api 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page