Skip to main content

garf for Knowledge Graph Search API

PyPI Downloads PyPI

garf-knowledge-graph-api simplifies fetching data from Knowledge Graph Search API using SQL-like queries.

Prerequisites

Installation

pip install garf-knowledge-graph-api

Usage

Run as a library

from garf.community.google.knowledge_graph import report_fetcher
from garf.io import writer


# Specify query
query = """
  SELECT
    result_score,
    @id AS id,
    @type AS type,
    description,
    image.url AS url
  FROM query
  WHERE {query}
""

# Fetch report
fetched_report = (
  report_fetcher.KnowledgeGraphApiReportFetcher()
  .fetch(query, query="<YOUR_SEARCH_QUERY_HERE">)
)

# 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 knowledge-graph-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
ids One or many Knowledge Graph Ids Multiple ids are supported, should be comma-separated
query Search query i.e. "Radiohead"

Metadata

Release files for garf-knowledge-graph-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-knowledge-graph-api 1.0.0
File Size Uploaded Provenance Actions
garf_knowledge_graph_api-1.0.0.tar.gz 5.9 kB Without provenance Details for garf_knowledge_graph_api-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 15.5 kB

Release files / garf_knowledge_graph_api-1.0.0.tar.gz

Download URL garf_knowledge_graph_api-1.0.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
220e3dcb92c6660dbc814d8bccdd4a502c5a4861cc6c9cf8cd8392e90c4df2bc
BLAKE2b-256 checksum
How to use checksums
35e1de279d3ee174727e0dd9d1c4f51a438a3cd5a4666acd96cc79b0ee5bd5a9
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_knowledge_graph_api-1.0.0-py3-none-any.whl

Download URL garf_knowledge_graph_api-1.0.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7419f5a5f1c6dde5969ef03c594cbd4b20f818663d6113f8658989cd4ab64b5d
BLAKE2b-256 checksum
How to use checksums
c97d8a55a794c05dd79ca13e8b00238e5f5baeb37c8ac2931f47f21f83fd58cf
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-knowledge-graph-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