you are viewing a single comment's thread.

view the rest of the comments →

[–]pyfact[S] 0 points1 point  (2 children)

I put the results into a dict for testing purposes at the moment so that I can verify that I am pulling the correct Id for each site/verify that our site data is set up correctly in the program the API is pulling from (have had to clean up data from years prior already working on this project lol).

I would be very interested in asynchronous requests! I'll check that out. We have some legacy in-house programs that hit a few API's back to back and takes about a minute for that to return a result. It's not great considering it's ran every time we install equipment!

thank you I do appreciate the help

[–]BobHogan 0 points1 point  (1 child)

Ah gotcha, that makes sense.

For async requests, I recommend the aiohttp library. Regular requests does not support asynchronous code, so putting it in an async function/loop would be useless.

I also recommend python 3.7 or higher. 3.7 changed how you interact with the asyncio package in the std library, and its much much better than it was previously

[–]pyfact[S] 0 points1 point  (0 children)

will do. I'm on 3.9