Metadata-Version: 2.1
Name: godto
Version: 0.0.2
Summary: Data Transfer Object (DTO) codegen from JSON schemas following the OpenAPI spec
Home-page: https://github.com/lmmx/godto
Author: Louis Maddox
Author-email: louismmx@gmail.com
Maintainer: Louis Maddox
Maintainer-email: louismmx@gmail.com
License: MIT
Project-URL: Bug Tracker, https://github.com/lmmx/godto/issues
Project-URL: Source Code, https://github.com/lmmx/godto
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: docs
Provides-Extra: tests
Provides-Extra: dev
License-File: LICENSE

# godto

Data Transfer Object (DTO) codegen from JSON schemas following the OpenAPI spec 

## Usage

To work with an OpenAPI schema, load it with the `Model` class,
which is a [Dataclass Wizard](https://github.com/rnag/dataclass-wizard/) deserialiser.

```py
from godto.openapi_v3 import Model

model = Model.from_json(schema_json)
```

For example the Transport for London `StopPoint` API schema
is [shipped as package data][StopPoint_schema] in `tubeulator`.

[StopPoint_schema]: https://github.com/lmmx/tubeulator/blob/master/src/tubeulator/data/openapi/StopPoint/StopPoint.json

```py
from pathlib import Path

path_to_schema = Path("data/openapi/StopPoint/StopPoint.json")
schema_json = path_to_schema.read_text()
```

## Requirements

Python 3.9 or 3.10

- Awaiting [bugfix](https://github.com/rnag/dataclass-wizard/issues/89) for 3.11+
