Skip to main content

Garf implementation for Google Merchant API

Project description

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_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-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

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_merchant_api-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garf_merchant_api-0.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for garf_merchant_api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 83311dfd082b04784c810280486c715637eeec1decdeeebd682213f6238a97ba
MD5 0dd82cc6e799fbdb8a3719fcdd95cabb
BLAKE2b-256 24530632e9da349083cc447cd317612f0230771c1112539a4232bf7abf6cbccb

See more details on using hashes here.

File details

Details for the file garf_merchant_api-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for garf_merchant_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8487f0b25b9f532eb4a474dd8034d2a36e98bc4f6d526b1a5d97cc40fb2ef39d
MD5 e90504a531b81ce514aba44017cea21e
BLAKE2b-256 2a397809e80e8aaa942539790aea040d54017e6e22b41d51da97092bd47e8c02

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