Created
October 6, 2015 14:43
-
-
Save djui/cfa5309674233bd3e4ce to your computer and use it in GitHub Desktop.
Simple script to export Goodreads exports
This file contains hidden or 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
#!/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