graphql-schema -> pydantic models
Project description
Qlligraphy. GraphQL Schema -> Pydantic models
Qlligraphy is a simple CLI tool, that generates pydantic models based on graphQL schema.
Installation
pip install qlligraphy
Usage:
Consider the following schema written in example.gql
enum Episode {
NEWHOPE
EMPIRE
JEDI
}
type Character {
name: String!
appearsIn: [Episode]!
}
Running:
qlligraphy example.gql -o example.py
Results in the following python file:
from enum import Enum
from typing import List, Optional
from pydantic import BaseModel
class Episode(str, Enum):
NEWHOPE = "NEWHOPE"
EMPIRE = "EMPIRE"
JEDI = "JEDI"
class Character(BaseModel):
name: str
appearsIn: List[Optional[Episode]]
Please note: This package is still in WIP state.
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
qlligraphy-0.1.3.tar.gz
(7.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qlligraphy-0.1.3.tar.gz.
File metadata
- Download URL: qlligraphy-0.1.3.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.7 Darwin/19.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f83bb9dee13cb2b843ac5a6fb105d947e935f710ae3a0fe9c8ae24bd405f348f
|
|
| MD5 |
385a7ce059f8b2d79c6cfc75041fe7b0
|
|
| BLAKE2b-256 |
1ea5a9ee67099f1aa368135dedba6407ca8b102f813f38e1b8c02d27601af9a8
|
File details
Details for the file qlligraphy-0.1.3-py3-none-any.whl.
File metadata
- Download URL: qlligraphy-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.7 Darwin/19.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83e5b828ce52d776376a63eb872e0f3e7284fe04f189718680d14208eb2100c7
|
|
| MD5 |
87652703b9148d7a6b9dd775fe92366a
|
|
| BLAKE2b-256 |
331d09b69e44754f7f1ef9a3738ffcc4fedbce5cde1694c5b21882dabc8985da
|