Package: go-over
What is "go over"?Go over is a python package designed to help manage data for a blog hosted with Jekyll. The package is a CLI suite of tools, which means that it will contain several independent tools. At the moment, though, it has only one (goodreads). Once installed, you can get detailed help by invoking the tool with no parameters.go-overInstallationThe package is provided as aPypyinstallable package. Usepip3to install it:pip3installgo-overAs always, it is recommended to use a virtual environment.go-over tool:goodreadsThe first tool provided bygo-overis a manager for data exported fromGoodreads.com. Goodreads provides a feature toexportyour library as a CSV. The tool can process that CVS file and generate JSON files to easily consume on usingliquidfrom yourjekyllblog.You will need to pass the CVS file to the tool:go-overgoodreads-ggoodreads_library_export.csvThis will generate the files in a folder with name./results. But call also tell where to generate the resulting files with the-roption:go-overgoodreads-ggoodreads_library_export.csv-r_dataUnfortunately, the data coming fromGoodreads.comis incomplete or does not contain all the information to customize your blog. Still, no worries, you can easily complement that with your data. To do so, you can provide a complementary JSON file with the-cparameter. If that file is not there,go-overwill generate it for you from the data on the original CVS file. Also, you can force the generation of this file at any time with the flag--force_complementary_rewriteor-f. Note that forcing the generation will only override the existing data, but no data will be lost from the complementary file.The complementary JSON file will have the form:{"books":[{"id":"17255186","title":"The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win","language":"EN","tags":"fiction, devops","format":"audiobook","my_review_url":"/gene-kim-the-phoenix-project/","read_dates":["2021/12/11"],"is_favourite":true},]}Where:language: Here, you can specify the language you use to read/listen to the book/audiobook.title: Book title. Sometimes the titles coming from the CSV are very long, and here you can shorten them.tags: You can add a list of tags to apply to the book.format:audiobook/softcover/hardcovermy_review_url: a partial like to you review of the book in Jekyll.read_dates: you might have read multiple times the book, here you can add a list of the dates with the formatYYYY/MM/dd. If you set this value tonull, the date on the original file will be used, which is the last read's date. Use this field if you have read it multiple times.is_favourite: you can mark books as favourites. When favourites exist, aJSONfile for the favourites will be generated.
Any data provided in the complementary file will override the original CVS file.You can explore the CLI help of this tool with:go-overgoodreads--helpSetting up the dev environmentI'm using a python virtual environment, and I have exported the configuration to a file calledvenv_requirements.txt. To start working, follow these steps:On the root folder, create the environment if you do not have it already with:python3 -m venv .venvStart the environment:source .venv/bin/activateInstall the requirements:pip install -r requirements.txtInstall the local package to edit:pip install -e ./You should be ready to go!With that done, you can run the test withpytest.
To run the test allowing for prints (not capturing) and inspecting fixtures run:pytest -v -s --setup-showWhen you finish, stop the virtual environment with:deactivateRun with demo dataIn thedemo/sourcefolder, you will find data to do a demo run and see how it works. To do so, without affecting your environment, follow these steps:(If not done already) Set up the environmentpython3 -m venv .venvActivate the environment:source .venv/bin/activate(If not done already) Install the requirements:pip install -r requirements.txtInstall the local package to edit:pip install -e ./go-over-vgoodreads-g./demo/source/goodreads_library_export.csv-c./demo/source/goodreads_complement.json-r./demo/resultsAfter doing this, in the results folder you will have all the generated files:>ls-lademo/results/
books_by_tags.json
books_favourites.json
books_read_2011.json
books_read_2018.json
books_read_2019.json
books_read_2020.json
books_read_2021.json
books_read_2022.json
books_read_no_date.json
books_reading.json
books_stats.json
books_to_read.jsonDeveloper noteNOTE: I'm new to python, so any advice on doing this better is highly welcome.