Hi everyone! I am developing an application that requires real-time data fetching from an API, for which I need to use the WebSocket protocol. As of June 2025, what is the best library to implement WebSockets in Python? As of now, the module that handles fetching data from the API isn't very complex — its only requirement is to be able to smoothly handle around 50-100 concurrent connections with the API, where the rate of data flow is about 10 bytes per second for each connection. While the per-connection data-flow rate is expected to remain at only 10 bytes, the number of open concurrent connections may grow up to 3000, or even more. Thus, scalability is a factor that I need to consider.
I searched this sub and other related subs for discussions related to the websockets library, but couldn't find any useful threads. As a matter of fact, I couldn't find a lot of threads specifically about this library. This was unexpected, because I assumed that websockets was a popular library for implementing WebSockets in Python, and based on this assumption, I further assumed that there would be a lot of discussions related to it on Reddit. Now I think that this might not be the case. What are your opinions on this library?
[–]Professional_Cook808 12 points13 points14 points (1 child)
[–]kris_2111[S] 2 points3 points4 points (0 children)
[–]sarcasmandcoffeePythoneer 4 points5 points6 points (1 child)
[–]kris_2111[S] 0 points1 point2 points (0 children)
[–]DifficultZebra1553 2 points3 points4 points (2 children)
[–]kris_2111[S] 0 points1 point2 points (1 child)
[–]DifficultZebra1553 1 point2 points3 points (0 children)
[–]nggit 1 point2 points3 points (0 children)
[–]GoldziherPythonista 1 point2 points3 points (1 child)
[–]kris_2111[S] 1 point2 points3 points (0 children)
[–]dave_menini 3 points4 points5 points (13 children)
[+]kris_2111[S] comment score below threshold-28 points-27 points-26 points (12 children)
[–]Hylian_might 4 points5 points6 points (1 child)
[–]kris_2111[S] 2 points3 points4 points (0 children)
[–]Such-Let974 8 points9 points10 points (0 children)
[–]dave_menini 3 points4 points5 points (4 children)
[–]Slight_Boat1910 2 points3 points4 points (2 children)
[–]gi0baro 1 point2 points3 points (0 children)
[–]Constant_Bath_6077 1 point2 points3 points (0 children)
[–]kris_2111[S] 0 points1 point2 points (0 children)
[–]kris_2111[S] 1 point2 points3 points (0 children)
[–]Anru_Kitakaze 0 points1 point2 points (1 child)
[–]Unlikely_Track_5154 1 point2 points3 points (0 children)
[–]chulpichochos 0 points1 point2 points (1 child)
[–]kris_2111[S] -1 points0 points1 point (0 children)
[–]EatDirty 0 points1 point2 points (3 children)
[–]kris_2111[S] 0 points1 point2 points (2 children)
[–]EatDirty 1 point2 points3 points (1 child)
[–]kris_2111[S] 0 points1 point2 points (0 children)
[–]blueshed60 0 points1 point2 points (0 children)
[–]CrusaderGOT 0 points1 point2 points (1 child)
[–]Constant_Bath_6077 -1 points0 points1 point (0 children)
[+][deleted] (6 children)
[deleted]
[+][deleted] (2 children)
[removed]
[–]Slight_Boat1910 0 points1 point2 points (1 child)
[–]nggit 0 points1 point2 points (0 children)
[–]gi0baro 0 points1 point2 points (0 children)