How to return multiple values from a request using FastAPI?

I’m trying to create an API using FastAPI + MongoDB that can return multiple values from the request. The MongoDB is full of data and using mongoengine I can consult one or all data when sending a request to the specific endpoint.
What I’m trying to do now is receive one or more data from an endpoint, for example:

How can I import file as normal user in python?

I have a python app that run bash shell commands that require root priviledges. In terminal I type “sudo python3 main.py” then load python app file. Python app run mostly sudo commands so I always have to run it with sudo python3 main.py. In the main.py file in the beginning I have import settings.py file that save some important settings. settings.py file read and write INI File in home folder /home/username/.config/myapp/config.ini. So when I run the main.py app the settings.py create a folder myapp inside /home/username/.config/ and then create the config.ini filename.

how to parse response immediately with asyncio.gather?

async def main(): uuids = await get_uuids_from_text_file() tasks = [] # create a task for each uuid # and add it to the list of tasks for uuid in uuids: task = asyncio.create_task(make_hypixel_request(uuid)) tasks.append(task) # wait for all the tasks to finish responses = await asyncio.gather(*tasks) # run the functions to process the data for … Read more