tiangolo
We just opened the public beta of FastAPI Cloud.
You can deploy FastAPI apps with the command fastapi deploy, or connect your GitHub repo, with logs, metrics, custom domains, teams, and managed deployments.
Announcement: https://fastapicloud.com/blog/fastapi-cloud-public-beta/
We are the same team behind FastAPI, building FastAPI Cloud.
We're looking for a Design Engineer who can also code frontend (or is learning to), to help us (mainly) make the dashboard the best developer experience possible for deploying FastAPI apps.
We prefer candidates with strong design skills over only strong frontend skills.
Please include your portfolio link or PDF and CV.
Email [email protected]
I created FastAPI, now I'm doing interesting new things and want extra help.
I'm looking for tons of skills and knowledge in SRE / DevOps / Platform / Cloud / name-it ...and FastAPI.
Email [email protected]
Working full time on open source, FastAPI and friends
This includes:
Concurrency, async and await, and how to mix it with blocking code.
request and g pseudo-global variables.
Advanced refactoring.
Migrating from Flask to FastAPI, part 3 (last part)
Migrating from Flask to FastAPI, Part 2.
This is the juicy part, all the main code changes from Flask to FastAPI, including some auth and dependencies.
From Forethought with love.
For the advanced stuff, including the g pseudo-global variable, more techniques migrating from Flask to FastAPI, and mixing async and await with blocking code, wait for the next part.
Migrating from Flask to FastAPI, Part 2
Here's the first blog post out of 3, with all the tips and tricks to migrate a real-life, huge, production code base.
I hope it's useful!
Migrating from Flask to FastAPI
If you want to see faster progress, there are several ways to help, they are all documented here: https://fastapi.tiangolo.com/help-fastapi/
One of the things that consumes time the most is handling issues by others. If you go and help them and they close those issues, that's a lot of minutes (in some cases hours) that you save me, and that I can then dedicate to review the other issues and PRs.
But I haven't documented it yet.
https://github.com/microsoft/pyright/blob/main/specs/datacla...
As Pyright already supports it, and Pylance is built on Pyright, they can use it directly. Hopefully more editors will use it and hopefully it will be part of the standard Python (in a PEP, with typing.dataclass_transform, and with mypy support).
And just in case you're wondering, there's no downside to having the dataclass_transform, anything that doesn't support it is unaffected, and nothing else would have completion either way.
In fact, I made a small utility library some time ago to create dynamic Pydantic models from SQLAlchemy models (https://github.com/tiangolo/pydantic-sqlalchemy), but that's only useful in a few cases, e.g. for response_model in FastAPI.
But it's all SQLAlchemy underneath, the most wiidely used Python SQL library, with tons of years of usage, so that gives some safety.
And the test coverage is at 97%. I will release 0.1.0 once test coverage reaches 100% and I have the main docs I want there.
The only caveat with the version is upgrades, as, as of now, anything could change (probably I won't change anything, just add stuff). But you can solve it by pinning the version, writing tests, and upgrading the version only after tests pass.
The only other issue you might have is that you really want to do some very advanced trick with SQLAlchemy and in some way it's still not supported. In that case you might want to use SQLAlchemy directly for that model, you can mix SQLAlchemy and SQLModel (although I haven't documented that yet).
And in particular, other libraries have done a great job, but I wanted to take advantage of the features that editors can provide, with autocompletion, inline errors, etc. SQLModel has lots of tricks to provide the best developer experience possible, e.g. autocompletion while creating a new model instance.
For example, the style of querying stuff, for example: https://sqlmodel.tiangolo.com/tutorial/where/#where-and-expr...
But as @tomnipotent says below, a SQLModel is also a Pydantic model, so, you can use the same model to do automatic API data validation, serialization, documentation, filtering... and now, also define the database.
There's no more integration, apart from the fact that I built it to do just that, and I made sure everything works just right with FastAPI.
But for any other framework that doesn't have automatic data validation, documentation, serialization, etc. (and you are just doing that by hand) it's an even simpler problem, so SQLModel will work just right, as any other ORM.
It's all just SQLAlchemy, so the same migrations with Alembic would do it, I plan on documenting that in the future and probably adding a thin layer on top.
And SQLModel, the same as those two dependencies, are independent of any framework, so you can combine them with anything you need.
Thanks for sharing!
This is the biggest thing I've built since FastAPI and Typer...
SQLModel is a library for interacting with SQL DBs, based on Python type hints.
Each model is both a Pydantic and SQLAlchemy model, and it's all optimized for FastAPI.
GitHub here: https://github.com/tiangolo/sqlmodel
More info in this Twitter thread: https://twitter.com/tiangolo/status/1430252646968004612
And the docs are here: https://sqlmodel.tiangolo.com/