How can i list all the files that are in a repository?

i am trying to make a script in python and we need to know what files are in the repository so we can check the version we have up there and figure out what to upload later on.

is there an Api that list the files? (might be some pagination to do) or there is a python library for that?

thanks guys.