dev notes

software development craftsmanship

/ home [ / blog / letter / springer link / brain / relaunch / time for money, money for time / first steps with rasmus / connect the dots / get in touch with vue / Alternative content management system approach / A database gate keeper / Generate a ERM from a PostgreSQL database schema / Working with immutable data in Postgres / Automatically update MIT licenses / Moving ORM Mapping towards the database / providing test data for databases / using pandoc filters to create graphs with hakyll / get in touch with react / six months in new job / days left / minimum viable product / Repository ownership / getting better / git cleanup ]

2020-06-15

springer link

Due to the covid 19 outbreak springer is launching a global program to support learning worldwilde.

Harish Narayanan build a small python project to build a static website from the springer provided excel files. The result looks interesting, because you can use the book links, without having excel installed.

The script looks as following:

rt pandas as pd
from jinja2 import Environment, FileSystemLoader


books_df = pd.read_excel("./input/Free+English+textbooks.xlsx")
grouped_books_df = books_df.groupby(["English Package Name"])


loader = FileSystemLoader(searchpath="./templates/")
env = Environment(loader=loader)
template = env.get_template("index.html")

grouped_books = {}

for group, books in grouped_books_df:
    grouped_books[group] = []
        for book in books.iterrows():
                  grouped_books[group].append(book)

                  rendered_template = template.render(grouped_books=grouped_books)

with open("index.html", "w") as f:
    f.write(rendered_template)

Just a few lines of python and an excel sheet looks much nicer.