Metadata-Version: 2.1
Name: qlligraphy
Version: 0.1.2
Summary: graphql-schema -> pydantic models
Home-page: https://github.com/kuchichan/QLligraphy
License: BSD-3-Clause License
Author: kuchichan
Author-email: pawel.kucharski@hotmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: astunparse (>=1.6.3,<2.0.0)
Requires-Dist: black (>=22.1.0,<23.0.0)
Requires-Dist: graphql-core (>=3.2.0,<4.0.0)
Requires-Dist: isort (>=5.10.1,<6.0.0)
Requires-Dist: pydantic (>=1.9.0,<2.0.0)
Project-URL: Repository, https://github.com/kuchichan/QLligraphy
Description-Content-Type: text/markdown

# Qlligraphy. GraphQL Schema -> Pydantic models 

Qlligraphy is a simple CLI tool, that generates pydantic models based on graphQL schema. 

## Installation

``` shell
pip install qlligraphy
```

## Usage:
Consider the following schema written in `example.gql` 

``` graphQL 
enum Episode {
 NEWHOPE
 EMPIRE
 JEDI
}

type Character {
  name: String!
  appearsIn: [Episode]!
}
```

Running:

``` shell
qlligraphy example.gql -o example.py
```

Results in the following python file: 

``` python
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


