A generator of pipestat-based APIs
Project description
pipestat_reader - web API generator for pipeline results
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
- Create a
pipestat.PipestatManager
object
import pipestat
psm = pipestat.PipestatManager(config="/path/to/config.yaml")
- Pass the objects to the
pipestat_reader.PipestatReader
constructor
import pipestat_reader
psr = pipestat_reader.PipestatReader(pipestat_managers=[psm])
- Generate a GraphQL schema
graphql_schema = psr.generate_graphql_schema()
- 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))
- 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
Release history Release notifications | RSS feed
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.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for pipestat_reader-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 479d2a65d3b08473e842125ea9699461e9ac9eb06c0a84d02fd259eac141e61f |
|
MD5 | e7f4440c5af247257016b4777904933d |
|
BLAKE2b-256 | 4c50447b37ff589b4a85b3a6aa0c93d09bbaab9be14f5e771f7e0c8867027e90 |