https://github.com/frankie567/plain-client
A Python client for Plain GraphQL API
https://github.com/frankie567/plain-client
Last synced: 6 months ago
JSON representation
A Python client for Plain GraphQL API
- Host: GitHub
- URL: https://github.com/frankie567/plain-client
- Owner: frankie567
- License: mit
- Created: 2025-01-07T09:12:11.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-06T09:49:25.000Z (8 months ago)
- Last Synced: 2025-04-14T01:52:37.465Z (6 months ago)
- Language: Python
- Homepage: https://frankie567.github.io/plain-client/
- Size: 170 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Plain Client
A Python client for Plain GraphQL API[](https://github.com/frankie567/plain-client/actions)
[](https://badge.fury.io/py/plain-client)---
**Documentation**: https://frankie567.github.io/plain-client/
**Source Code**: https://github.com/frankie567/plain-client
---
> [!IMPORTANT]
> This client is generated **automatically** using:
> * [ariadne-codegen](https://github.com/mirumee/ariadne-codegen)
> * [Plain GraphQL Schema](https://core-api.uk.plain.com/graphql/v1/schema.graphql)
> * Fragments, mutations and queries provided by Plain in their [official TypeScript SDK](https://github.com/team-plain/typescript-sdk/tree/main/src/graphql)## Quickstart
```bash
pip install plain-client
``````py
from plain_client import Plainclient = 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](https://hatch.pypa.io/latest/install/) 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:
```bash
hatch run generate
```It'll automatically download latest schema, fragments, mutations and queries provided by Plain.
### Run unit tests
You can run all the tests with:
```bash
hatch run test:test
```### Publish a new version
You can bump the version, create a commit and associated tag with one command:
```bash
hatch version patch
``````bash
hatch version minor
``````bash
hatch version major
```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:
```bash
hatch run docs-serve
```It'll automatically watch for changes in your code.
## License
This project is licensed under the terms of the MIT license.