Upload a file using REST API

I want to upload files using a REST API, is this possible to do in python? If so, what is the correct way to implement it?

I want to add the file_url as query params and add it to files repo

You might find some hints here: