2021-03-08 11:49:10 -05:00
|
|
|
""" handle reading a csv from goodreads """
|
2021-03-30 11:56:25 -04:00
|
|
|
from . import Importer
|
2020-03-25 08:29:21 -04:00
|
|
|
|
2020-03-29 03:05:09 -04:00
|
|
|
|
2021-02-20 11:02:36 -05:00
|
|
|
class GoodreadsImporter(Importer):
|
2021-03-30 11:46:22 -04:00
|
|
|
"""GoodReads is the default importer, thus Importer follows its structure.
|
|
|
|
For a more complete example of overriding see librarything_import.py"""
|
2021-03-30 11:43:38 -04:00
|
|
|
|
2021-03-08 11:49:10 -05:00
|
|
|
service = "GoodReads"
|
2020-03-25 08:58:27 -04:00
|
|
|
|
2021-03-30 11:43:38 -04:00
|
|
|
def parse_fields(self, entry):
|
2021-04-26 12:15:42 -04:00
|
|
|
"""handle the specific fields in goodreads csvs"""
|
2021-03-30 11:43:38 -04:00
|
|
|
entry.update({"import_source": self.service})
|
2021-02-20 11:02:36 -05:00
|
|
|
# add missing 'Date Started' field
|
2021-03-30 11:43:38 -04:00
|
|
|
entry.update({"Date Started": None})
|
|
|
|
return entry
|