Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tiangolo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
tiangolo
7y ago
FastAPI creator here... if you use FastAPI, HTTPX would probably be the best match for sending requests, just saying... :D
62.
▲
by
tiangolo
7y ago
This is awesome! And soon to be updated/integrated into FastAPI, with all the new features.
63.
▲
by
tiangolo
7y ago
Thanks for the mention @timothycrosley! I feel honored :)
64.
▲
FastAPI now has full support for all ORMs: SQLAlchemy, Peewee, Mongoengine, etc.
1 points
by
tiangolo
7y ago
|
0 comments
65.
▲
by
tiangolo
8y ago
Nice observation! Yes, most of the tests come directly from the docs, that way, by having full test coverage, means that at least a big part of the functionality is not only tested but also documented somewhere.
66.
▲
by
tiangolo
8y ago
That's great!
67.
▲
by
tiangolo
8y ago
Thanks for chiming in @tomchristie!
68.
▲
by
tiangolo
8y ago
Yep, agree. Thanks for the clarification.
69.
▲
by
tiangolo
8y ago
Wow, thanks! I take it as a high compliment. :D Thanks for paving the way with Hug. And thanks for helping make the Python ecosystem a friendly, and welcoming community.
70.
▲
by
tiangolo
8y ago
:)
71.
▲
by
tiangolo
8y ago
> Golang has libraries for all of the things you mentioned, and web tools to generate APIs based on those schemas. [...] Would you cite some? I would love to see the links, packages, etc. And how could you achieve the same in Go: Having
72.
▲
by
tiangolo
8y ago
Molten also helped inspire parts of FastAPI. And they are indeed quite similar in several things. Molten is based on WSGI, FastAPI is based on ASGI. So, you can do async/await stuff in FastAPI. FastAPI inherits directly form Starlette,
73.
▲
by
tiangolo
8y ago
And Uvicorn, the server, is compatible with PyPy. So, you can run FastAPI with PyPy, if you need :)
74.
▲
by
tiangolo
8y ago
I guess the tradeoff is speed and convenience. If we wanted to have the absolute best performance, we would have to write web apps in C. But it would be quite more cumbersome.
75.
▲
by
tiangolo
8y ago
If the bottleneck is computation, make sure you are using Numpy, Pandas, Dask, and the whole family of scientific Python. If it's IO, check asyncio tools. E.g. aiofiles.
76.
▲
by
tiangolo
8y ago
Yep, this is based on Starlette, which does more or less, what you did, but for ASGI.
77.
▲
by
tiangolo
8y ago
Yep, there are a couple of project generators, including Docker integration, Celery, a simple frontend, load balancer with HTTPS etc. In two flavors: * With PostgreSQL and SQLAlchemy: https://github.com/tiangolo/full-st
78.
▲
by
tiangolo
8y ago
That's great to hear!
79.
▲
by
tiangolo
8y ago
Yep, and Hug was one of the first tools I saw with this style of declaring parameters with types in the functions, along with APIStar. Great job! And thanks. It helped inspiring the creation of FastAPI. Apart from other of your tools that I
80.
▲
by
tiangolo
8y ago
It's designed to be very helpful while building web APIs that communicate JSON over HTTP. You can have semi-automatic data validation, serialization (converting from JSON to Python data types, etc). And an automatic web user interface
81.
▲
by
tiangolo
8y ago
Yeah, the advantage here over Go would be to have automatic data validation, serialization, and documentation, all based on standards: OpenAPI and JSON Schema. Including automatic web user interface for API documentation. And maybe the depe
82.
▲
by
tiangolo
8y ago
To use Python type hints, and get automatic data validation, serialization, and documentation for your API (including interactive UI docs for your API). All that, even for deeply nested JSON bodies. And by using type hints, you get autocomp
83.
▲
by
tiangolo
8y ago
> Looks great; been searching [...] That's great! > Small wrinkle [...] Oops, good catch! Thanks. It's fixed now.
84.
▲
by
tiangolo
8y ago
Awesome!
85.
▲
by
tiangolo
8y ago
:D
86.
▲
by
tiangolo
8y ago
Exactly. Totally agree.
87.
▲
by
tiangolo
8y ago
Yeah, the idea is to take inspiration from Go and similar languages, using the new async (coroutine) features in Python that give it better concurrency handling, and the benefits of types. Without having to deal with a lower-level language.
88.
▲
by
tiangolo
8y ago
Yeah, in fact, up to FastAPI, my main stack was based on Flask with several plug-ins, and I created several project generators with all that. FastAPI learned a lot from many of these tools and techniques.
89.
▲
by
tiangolo
8y ago
That's great to hear!
90.
▲
by
tiangolo
8y ago
Exactly! FastAPI inherits a lot from Tom Christie's great work. Even the heaviest inspiration is form APIStar (now "deprecated" as a server). Built by him too.
More ›