Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Adding better DX to my package

After more than a year of active development, I finally publish my package to PyPI!

```bash
pip install socketify
```

After some people asks to also create a WSGI and ASGI server to improve projects using other frameworks, I worked hard to get it right.

But in the end, we outperform uvicorn and meinheld with Flask, Django, Emmett, FastAPI, and Falcon in TechEmPower plaintext with our WSGI and ASGI servers!

And we got the Top 1 with socketify itself!

https://www.techempower.com/benchmarks/#section=test&runid=7ce481b2-49ec-4a4d-952d-bb1334d4a4ad&test=plaintext&l=hra0hr-35r

Also added a CLI tool with very familiar options for uvicorn and gunicorn users

CLI: https://docs.socketify.dev/cli.html

Also added lifespan (start and shutdown) events to socketify itself, and added an improved DX for routing and support to Extensions/Plugins.


```python
# main.py
from socketify import App

def run(app: App):
@app.on_start
async def on_start():
# we can start connection pools here
pass

@app.on_shutdown
async def on_shutdown():
# and here we can clean connection pools
pass

router = app.router()
api = app.router(prefix="/api")
private =

/r/Python
https://redd.it/107abiy
What is the framework overhead of flask compared to say fastapi excluding database access?

For an API that is more like calculation-based, no database access, so each request just runs a method/algorithm based on the input and returns a result. calculations are light, maximum a couple ms. In some cases results can be svg images.

Does fastapi still have any advanatge vs flask in such a use-case in terms of performance? eg async shouldn't really help in this use-case?

When I look at the techempower benchmarks I assume my use-case would be similar to "flask-raw"?

/r/flask
https://redd.it/16ualsf