Plain Client¶
A Python client for Plain GraphQL API
Documentation: https://frankie567.github.io/plain-client/
Source Code: https://github.com/frankie567/plain-client
[!IMPORTANT] This client is generated automatically using: * ariadne-codegen * Plain GraphQL Schema * Fragments, mutations and queries provided by Plain in their official TypeScript SDK
Quickstart¶
from plain_client import Plain
client = Plain("https://core-api.uk.plain.com/graphql/v1", {"Authorization": "Bearer YOUR_API_KEY"})
async def get_thread():
return await client.thread("THREAD_ID")
Development¶
Setup environment¶
We use Hatch to manage the development environment and production build. Ensure it's installed on your system.
Generate the client¶
You can trigger a generation of the client with:
It'll automatically download latest schema, fragments, mutations and queries provided by Plain.
Run unit tests¶
You can run all the tests with:
Publish a new version¶
You can bump the version, create a commit and associated tag with one command:
Your default Git text editor will open so you can add information about the release.
When you push the tag on GitHub, the workflow will automatically publish it on PyPi and a GitHub release will be created as draft.
Serve the documentation¶
You can serve the Mkdocs documentation with:
It'll automatically watch for changes in your code.
License¶
This project is licensed under the terms of the MIT license.