Hacker News new | ask | show | jobs
by hardwaresofton 2069 days ago
Hey just to let you know -- the reason I'd pick something like FastAPI over pyotr is because I don't want to write the OpenAPI -- I personally see code on the backend as the source of truth, and prefer for it to go the other way (Swagger/OpenAPI YAML/JSON generated from code).

Other than that, library looks cool! like connexion[0] but starlette based. Might be worth putting a comparison on your page?

[0]: https://github.com/zalando/connexion

1 comments

Thank you for the kind words!

> I personally see code on the backend as the source of truth

That is a perfectly valid approach, although when you need to coordinate development between multiple teams starting with a specification can be really helpful. That doesn't mean that the spec has to be written once and frozen, as long as everyone is aware of the changes and adapts accordingly.

> Might be worth putting a comparison on your page?

I have indeed started the development when I found that connexion does not completely meet my requirements. The main difference is that pyotr supports ASGI, so can work with any ASGI framework (I haven't tried it with Mangum yet, but am planning to). Additionally, pyotr has a client component, which was inspired by Bravado.

> That is a perfectly valid approach, although when you need to coordinate development between multiple teams starting with a specification can be really helpful. That doesn't mean that the spec has to be written once and frozen, as long as everyone is aware of the changes and adapts accordingly.

True! I wonder if there's a good way to actually keep teams abreast. I actually end up writing specs by hand from time to time when I just want to get started quickly, but it can be such a pain.

Oh but one of the cool things I was able to set up is automatic generation of client libs (and pushing to a git repo) with GitLab -- it's really awesome to be able to automatically generate client libs that match your API versions.

> I have indeed started the development when I found that connexion does not completely meet my requirements. The main difference is that pyotr supports ASGI, so can work with any ASGI framework (I haven't tried it with Mangum yet, but am planning to). Additionally, pyotr has a client component, which was inspired by Bravado.

So I didn't actually know what ASGI was until I read your existing documentation! I'm not a huge python person but I'd heard of WSGI and some of the other variants but hadn't heard of ASGI! Thanks for the background on the client as well