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]]
NOTE: This package 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.2.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for qlligraphy-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad96ccd8056a4016edbc17f36754e09e6ddcb2d0d6c4dca67531c268fe515a62 |
|
MD5 | 72d7711ea040a2780d424df4cba707ee |
|
BLAKE2b-256 | 9920493f978b52bd06fd6031a2f26b10a4fabbf516d7d5209996f798d5260719 |