Skip to main content

description

Project description

garf for Knowledge Graph Search API

PyPI Downloads PyPI

garf-knowledge-graph-api simplifies fetching data from YouTube Data API using SQL-like queries.

Prerequisites

Installation

pip install garf-knowledge-graph-api

Usage

Run as a library

from garf_knowledge_graph_api 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"

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

Uploaded Source

Built Distribution

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

garf_knowledge_graph_api-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file garf_knowledge_graph_api-0.0.1.tar.gz.

File metadata

File hashes

Hashes for garf_knowledge_graph_api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fe4756f14f37397ba7481009ea5cd19c43e876602d6b31702addff1122c6d8a7
MD5 2743699ec5aaf6adb23003c0d8b977f3
BLAKE2b-256 276b2ae1ccea8f0b67f279468bfc4d91ce3d966a98263e3053b174bf83f28147

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for garf_knowledge_graph_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e81ca808aeb70947326054eb0135af2d500bf7357f29c39f4d9ef48e94e66970
MD5 bf3266ba6b6f6096a0cd15d78ca6819e
BLAKE2b-256 b722ee0b603aedd21d63b3d2092c95d12441b543e7145888386a1aa33032e74e

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