I've been working on a web search interface for #Python documentation as a personal project, and I think it's ready for other people to use...
Please give it a go (and join me in praying to the server gods):
https://t.co/3HIuiWDEHw
Blog post: Just because each item makes sense doesn’t mean they make sense together
https://t.co/qhFGZGcYGX
Not sure what Twitter (sorry X) is like these days, trying out a post...
Thanks to @PyMNtos for hosting my talk - "Build a simple web app with @htmx_org and @FastAPI"! The code and slides can be found here: https://t.co/mCcIVat9Ps and I'm planning to follow up with a blog post.
Tired of browsing #Python API docs online 😴 ?
Why not browsing them offline, directly in your terminal, thanks to #Griffe and #Textual 😎 ?
https://t.co/U6w8wlaL6l
🚀 FastAPI Performance +265% 🚀🚀- 10 Tips from @marcelotryle maintainer of @FastAPI , Uvicorn, @pydantic and and #Starlette at @EuroPython:
1️⃣ use uvloop, performance +10%🚀, uvloop is a fast, drop-in replacement of the built-in asyncio event loop
2️⃣ use httptools - faster parsing +10%🚀, Python binding for nodejs HTTP parser, you just need to have it installed in your environment
3️⃣ use bigger threadpool +5%🚀
4️⃣ use simple async application, +15%🚀, no overhead of threads
5️⃣ remove duplicate validation, have only FastAPI do the validation +25%🚀
6️⃣ use ORJSON + 5% 🚀(if not using the latest Pydanctic version already)
7️⃣ consider running without validation is an option, 150%, without logging +25%. Both not a general recommendation!
8️⃣ use the most recent version of FastAPI, + 265% 🚀- this is related to pydantic going rust
9️⃣ use ASGI Middleware: see https://t.co/nAZuc0f42x
🔟 compress responses
@FastAPI will now use the function's return type to create docs and validate data against that Pydantic model.
At first, I was worried for a second, because sometimes I return dicts or Pydantic models that are different from the response_model.
Let me show some examples:
@treyhunner It's probably a bit too dynamic for real world use, but I thought this method of constructing a dataclass from local vars is pretty fun:
https://t.co/nYjSxd4dX2
@browniepoints@davidfowl I did the same with my Surface Laptop. Noise-wise it's a little better but the main benefit is my laptop no longer thermal throttles.
Just published the first (very much alpha) release of Datasette 1.0!
It previews the new authenticated JSON write API, which lets you create tables in your Datasette instance and insert/update/delete rows in them
Release notes here: https://t.co/3AiQMgcKQo
To start your Monday, FastAPI 0.87.0 🔖
🚀 Upgraded Starlette, new TestClient based on HTTPX, @marcelotryle built https://t.co/XmTCgvdgmR to help you migrate
🚨 New WebSocketException https://t.co/XPgKror28x
⬆ Deps upgraded
🤓 Help Maintain FastAPI: https://t.co/9zR10xDTQl
Simon Willison (@simonw), the creator of Datasette, writes about SQLite and the challenges of building a server-side web application that also works in Electron and WebAssembly. It's a great read — I hope you enjoy it and hopefully learn something.