summaryrefslogtreecommitdiff
path: root/booklist.py
diff options
context:
space:
mode:
Diffstat (limited to 'booklist.py')
-rw-r--r--booklist.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/booklist.py b/booklist.py
new file mode 100644
index 0000000..c210a23
--- /dev/null
+++ b/booklist.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+
+"""
+Parsing/managing a book wishlist.
+
+ - parse list
+ - store list
+ - get extra info (isbn &c)
+ - group by author
+ - intelligent detection of author misspelling/title misspelling
+ - online matches? goodreads?
+
+"""
+
+import sys
+
+
+def read_booklist(file="booklist.txt"):
+ try:
+ with open(file) as f:
+ for line in f:
+ print(line)
+ except OSError as exc:
+ tb = sys.exc_info()[-1]
+ lineno = tb.tb_lineno
+ filename = tb.tb_frame.f_code.co_filename
+ print(f'{exc.strerror} at {filename} line {lineno}.')
+ sys.exit(exc.errno)
+
+
+def main():
+ """ main function, do stuff """
+ read_booklist("booklist.txt")
+
+
+if __name__ == '__main__':
+ main()