Skip to main content

A generator of pipestat-based APIs

Project description

pipestat_reader - web API generator for pipeline results

Code style: black

Pipestat reader is a Python package that is an extension of pipestat.

Pipestat can be used to collect pipeline results and store them in either a YAML-formatted file or in a database. If the results are stored in the database, then pipestat reader can be used to automatically generate a web API to query these results.

Usage

  1. Create a pipestat.PipestatManager object
import pipestat

psm = pipestat.PipestatManager(config="/path/to/config.yaml")
  1. Pass the objects to the pipestat_reader.PipestatReader constructor
import pipestat_reader

psr = pipestat_reader.PipestatReader(pipestat_managers=[psm])
  1. Generate a GraphQL schema
graphql_schema = psr.generate_graphql_schema()
  1. Use the schema in your web application, for example in FastAPI:
from fastapi import FastAPI
from starlette.graphql import GraphQLApp

app = FastAPI(title="test app")
app.mount("/graphql", GraphQLApp(schema=graphql_schema, graphiql=True))
  1. Retrieve the results reported with pipestat

By POST queries

curl -X POST \
-H "Content-Type: application/json" \
-d '{"query": "{table_name{edges{node{column_name}}}}"}' \
http://0.0.0.0:8000/graphql/

Using the interactive GraphiQL interface at http://0.0.0.0:8000/graphql/

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

pipestat_reader-0.0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pipestat_reader-0.0.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pipestat_reader-0.0.3.tar.gz.

File metadata

  • Download URL: pipestat_reader-0.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pipestat_reader-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5f3f374999428ab36b89f8700b76ab0d11ae57bb6739ac89faf9e1c6fce5a2e3
MD5 84ba4c88c66ea38b40defa83c4442447
BLAKE2b-256 ad2e2492537295b6abbbacd9fd7871b1109f6bf15e0f9de4201bc8aa7d5b1920

See more details on using hashes here.

File details

Details for the file pipestat_reader-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pipestat_reader-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ce209a5ec39cdb38b0546ade45428df59ae385c0df055398768bb94f40059be
MD5 7a6fbac054650bde9d3f86559512acf0
BLAKE2b-256 b330c1055346205ccae681880053241c78bcc47b2910072f23f504162c4a3574

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page