I want to write the following curl command into python code. Following is the command for requesting some data from the URL.
<user_name> : replace with the username
<api_token> : replace with the token secret key
curl -u <user_name>/token:<api_token> <URL>
We can use requests module:
response = requests.get(<URL>, auth = (f'{<user_name>}/token', <api_token>))