1
0
Fork 0
bookwyrm/bookwyrm/importers/goodreads_import.py

17 lines
544 B
Python
Raw Normal View History

2021-03-08 08:49:10 -08:00
""" handle reading a csv from goodreads """
2021-03-30 08:56:25 -07:00
from . import Importer
2020-03-29 00:05:09 -07:00
2021-02-20 17:02:36 +01:00
class GoodreadsImporter(Importer):
2021-03-30 08:46:22 -07: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 08:43:38 -07:00
2021-03-08 08:49:10 -08:00
service = "GoodReads"
2020-03-25 12:58:27 +00:00
2021-03-30 08:43:38 -07:00
def parse_fields(self, entry):
2021-04-26 09:15:42 -07:00
"""handle the specific fields in goodreads csvs"""
2021-03-30 08:43:38 -07:00
entry.update({"import_source": self.service})
2021-02-20 17:02:36 +01:00
# add missing 'Date Started' field
2021-03-30 08:43:38 -07:00
entry.update({"Date Started": None})
return entry