News for hackers. Stuff that matters.
Re:Django 3 by BerislavLopac on Monday December 02, 2019 @10:22AM (#21683124)
Pyotr [0] is a small library I've been developing for a while, based on Starlette. In a nutshell, it takes an OpenAPI specification and turns it into an API application, taking care of all the routing and validation according to the spec. It is conceptually similar to connexion [1], but it supports async and is Python 3 only. There is also a client component, in the spirit of bravado [2].

[0] https://pyotr.readthedocs.io

[1] https://connexion.readthedocs.io/

[2] https://github.com/Yelp/bravado

Re:Django 3 by dtkav on Monday December 02, 2019 @11:17AM (#21683776)
This is awesome! I'm one of the community maintainers of connexion (I added openapi 3 support), but I don't have write access to the repo, and it's been really tough to get any changes landed lately. nice work!
Re:Django 3 by BerislavLopac on Tuesday December 03, 2019 @03:45AM (#21690859)
Thank you! ^_^
Re:Django 3 by j88439h84 on Monday December 02, 2019 @02:05PM (#21685642)
What's the difference from fastAPI? https://fastapi.tiangolo.com/
Re:Django 3 by hultner on Monday December 02, 2019 @06:40PM (#21688340)
FastAPI generates specs from code, this generates code from specs
Re:Django 3 by BerislavLopac on Tuesday December 03, 2019 @03:44AM (#21690856)
Just a bit of clarification: Pyotr does not generate any code, it uses the spec as configuration to construct the necessary routes at the app initialization, as well as to validate requests and responses.
Re:Django 3 by hultner on Thursday December 05, 2019 @09:12AM (#21712367)
Yeah didn't mean literary code generation, Python's dynamic nature makes such steps unnecessary.

In a way it feels kinda lispy (in a good way) to me, data is code, small DSL for working more efficiently with specific domain.