4 ms·
Bogdan has put together an awesome framework with molten that I think can use a lot more visibility. With his permission, I've posted here to get more eyes on i
by dternyak 8y ago
Bogdan has put together an awesome framework with molten that I think can use a lot more visibility. With his permission, I've posted here to get more eyes on it. I'm excited to see how much attention it's getting.
For those who want to get started with molten, I've put together a boilerplate for a more full fledged production application here: https://github.com/dternyak/molten-boilerplate https://github.com/dternyak/molten-boilerplate
It demonstrates:
- OpenAPI (swagger)
- SQLAlchemy
- alembic
- py.test
- invoke (task management / CLI)
Feedback is super welcome on the boilerplate, which is partially inspired by https://github.com/Bogdanp/molten_cookiecutter https://github.com/Bogdanp/molten_cookiecutter
Bogdan has been incredibly friendly and helpful while I've been learning the ins and outs (and pestering him over email). I'm sure he'll be happy to answer any questions here as they come up.
Happy hacking!
- tankerdude 8y agoHow does this compare with Connexion? Uses Swagger/OpenAPI that then uses convention (or fully defined) packages, and methods for REST. Runs on top of Flask, and does a lot of all of the validation all from the yaml file. Plumbing taken care for you, etc. so you can focus on business logic?
- Bogdanp 8y agoI'm not familiar with Connexion (this was my first time hearing about it), but it seems, from reading its README, that the two approaches are polar opposites: in Connexion you write the schema first and that is used to hook up your API to your business logic, whereas in molten you write your API using normal Python code and idioms and an OpenAPI schema is generated from that code. As a user of Molten, you don't need to know anything about OpenAPI to be able to use it.
- deleted 8y ago[deleted]
- tankerdude 8y agoMolten does what I've seen in RoR land do. You decorate and document your schema. It then can spit out an OpenAPI spec, use its schema and tooling around OpenAPI. So it becomes a choice. A decision of writing mostly OpenAPI, or writing Python via an API that is defined by someone (or a small set of people). I'd personally rather learn OpenAPI specs as you're going to live in that world anyways, as it gives you so much tooling. It's not hard, and you could take that yaml file and generate code for other languages in case Python's performance specifically for that API (especially it if is a microservice), runs too slowly in the real world and need a faster runtime, etc.