Skip to content

Instantly share code, notes, and snippets.

@adammcmaster
Last active July 18, 2018 13:53
Show Gist options
  • Save adammcmaster/3f101fc50da68837bc08171d094b4556 to your computer and use it in GitHub Desktop.
Save adammcmaster/3f101fc50da68837bc08171d094b4556 to your computer and use it in GitHub Desktop.
Get Panoptes credited names
# 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