Last active
July 18, 2018 13:53
-
-
Save adammcmaster/3f101fc50da68837bc08171d094b4556 to your computer and use it in GitHub Desktop.
Get Panoptes credited names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires panoptes-client 1.1 or newer | |
from panoptes_client import User | |
with open('login-names.txt') as users_f: | |
users = {u for u in (s.strip(' "\n') for s in users_f.readlines()) if not u.startswith('not-logged-in-')} | |
# A set comprehension inside a list() to weed out duplicates and then make it sortable | |
credited_names = list({u.credited_name for u in User.where(login=users)}) | |
credited_names.sort() | |
with open('credited-names.txt', 'w') as out_f: | |
out_f.write("\n".join(credited_names)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment