Prefect 2.0
You can interact with the Orion REST API using an asynchronous client:
from prefect.client import get_client
async with get_client() as client:
response = await client.hello()
print(response.json())
Prefect 1.0
Prefect 1.0 is based on GraphQL API which can be accessed using prefect.Client()
:
from prefect import Client
client = Client()
response = client.graphql("query string...")
print(response)