New web framework for Python in development
github.com
github.com
FastAPI is the sweetest and the most intuitive web framework.
I just checked a few doc pages for your framework, seems heavily inspired by FastAPI.
So what have you not found in FastAPI that is making you write a new web framework from scratch?
Also, building a framework is also a nice way of understanding how the sausages are made :)
For web I love this approach and have moved more towards this myself.
Pydantic has it's place in my opinion, there are other packages that do a similar thing and for most use cases you can roll your own pretty effectively. For me that place is marshalling on the wire data to a typed custom data type with validation. Whether you are using JSON, or {binary format}.
You likely need to write the validation code yourself since you should be validating from the database as well.
So there we go, I am anti ORM as well.
Anything relates to the request should be handled at the "request layer" which in my case is flask(werkzeus) and maybe per request DB connection should be created at that layer.
Everything else should be in a business layer, that way which framework you use doesn't matter and can be trivially replaced with something else.
https://github.com/oddbit-project/rick_db - postgresql query builder & object mapper - it is built around the concept of pure data objects (no indirect references do open resources) that can represent application data between layers; It also features a forward-only migration manager;
https://github.com/oddbit-project/rick - plumbing, validation & assorted logic - provides service locators, registries, containers (including dependency injection); validators, forms & request validation (with support for laravel-style validation chains), and a bunch of other stuff;
https://github.com/oddbit-project/pokie - flask-based web meta-framework, focused on REST api design, that brings components from the other two projects into an modular applicational framework;
You'd need to do a little work have flasks blueprints with prefixes and that makes me feel like this might not scale all that well?
Handling get, post, delete to the same URL is handled by an If statement in the handler function which in a lot of cases would dispatch to another function that handles get requests vs another than handles post requests. It feels weird you have to write this dispatcher.
This is a very minimalistic framework. I feel like the simplicity lends itself to a very small application like a service that just does one very simple thing.
Maybe if you don't already know another framework, e.g. you are a scientist who just wants to put an API on your analysis function, this might be a nice tool.
At the same time it feels like the lack of depth would bite you pretty fast for anything complex.
Are document oriented databases a viable solution for a general purpose web app use case?
E.g. many web apps involve relations (user authored a comment, user liked a blog post) and traversing them (show comments with best score, show all liked posts). Is panther a good tool for developing features like this?
It's been a while since I worked with a document oriented database; perhaps modern releases don't have a problem with this use case?