Install $ [sudo] pip install githubusercontent Features generate raw.githubusercontent.com urls like https://raw.githubusercontent.com/owner/repo/master/path/to/file replace special characters Examples >>> from githubusercontent import githubusercontent >>> githubusercontent("owner/repo", "folder/image.png") 'https://raw.githubusercontent.com/owner/repo/master/folder/image.png' # replace special characters >>> githubusercontent("owner/repo", "folder/image 1.png") https://raw.githubusercontent.com/owner/repo/master/folder/image%201.png Sources githubusercontent.githubusercontent(fullname, relpath, branch="master")