Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
executable file 40 lines (32 sloc) 964 Bytes
#!/usr/bin/env python2
# -- coding: utf-8 --
import os
import sys
import requests
from getpass import getpass
# Using this method of secret storing:
import credentials
token = credentials.API_key
except Exception as e:
print (e)
token = getpass()
credentials_file = open("", "w")
credentials_file.writelines("API_key = \"" + token +"\"")
API_URL = ''
def get_api_key():
return token
def get_headers(token=None):
if token:
return {
'Authorization': 'Token %s' % token,
'content-type': 'application/json'
return {'content-type': 'application/json'}
def display_progress(current, total):
percent = (current / total) * 100.00
sys.stdout.write("\r%d%%" % percent)