Skip to content

Instantly share code, notes, and snippets.

@djui
Created October 6, 2015 14:43
Show Gist options
  • Save djui/cfa5309674233bd3e4ce to your computer and use it in GitHub Desktop.
Save djui/cfa5309674233bd3e4ce to your computer and use it in GitHub Desktop.
Simple script to export Goodreads exports
#!/usr/bin/env python3
import csv
import sys
def main(args):
if not args:
return 'Usage: goodreads-export FILE'
with open(args[0]) as fp:
for row in csv.DictReader(fp):
if not row['Date Read']:
continue
print('{} {:13} {} - {}'.format(row['Date Read'].replace('/', '-'), row['ISBN13'].strip('="'), row['Title'], row['Author']))
if __name__ == '__main__':
try:
sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt:
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment