Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get OS X icons. Thanks to Brett Terpstra.
# Adapted from Brett Terpstra script :
# Fetches the 1024px version of an OS X app icon. The result is displayed in Pythonista's console, you can tap and hold to save or copy it.
# If you find any bug, you can find me @silouane20 on Twitter.
from PIL import Image
from StringIO import StringIO
import re
import requests
def find_icon(terms):
search_url = ''+ terms +'&entity=macSoftware'
res = requests.get(search_url)
m ='artworkUrl512":"(.+?)", ', res.text)
if m:
found =
return found
def main():
terms = raw_input("Input app name: ")
icon_url = find_icon(terms)
if icon_url:
file = requests.get(icon_url)
image =
print "Failed to get iTunes url"
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.