generate an image with a tao te ching quote and display it on snow's kindle
Find a file
2024-07-26 13:21:32 +02:00
.gitignore removing duplicate photo 2024-07-26 13:20:58 +02:00
first_verse.png publishing the project 2024-07-26 13:04:40 +02:00
generate_image.py publishing the project 2024-07-26 13:04:40 +02:00
kindle_photo.png publishing the project 2024-07-26 13:04:40 +02:00
README.md publishing the project 2024-07-26 13:04:40 +02:00
Tao Te Ching.pdf publishing the project 2024-07-26 13:04:40 +02:00
Tao Te Ching.txt publishing the project 2024-07-26 13:04:40 +02:00

Automated Infodumping

I really enjoy the fact that Tao Te Ching by Lao Tzu exists. The first translation I have ever read was Carol Deppe's. It's simple, made with some artistic liberty to read more easily, so it was a great intro.

I wanted to infodump about it to snow but that's a lot of content to speak or type, even for me. But she did some computer magic to a kindle and exposed http://kindle.sn0w.cx/data which accepts image data in POST requests and displays them on that kindle (somewhere in her house).

Then I found out about this beautiful font Compass by somepx.

And now I connected those two dots into the inspiration for this quick project.

The Tao that can be told is not the eternal Tao. The name that can be named is not the eternal name. Unnamable is the essence. Naming is the beginning of ten thousand particular things. Named are the manifestations. Nameless is the mystery.

photo of the kindle displaying the same quote image as above

The code

This is very spaghetti code - don't use it as a good example of programatic image generation. I was writing it as I was experimenting and silly reasons don't justify refactoring time. It works!

The code runs every day but it only generates and sends an image every 3 days. It takes the next quote that it hasn't shown yet, finds the right font size and line breaks in a very inefficient way, adds the attribution for the translator of the book and the font author, and POSTs it to snow's kindle.

Result

Now all my infodumping about Tao Te Ching will happen automatically! It will happen over *quick math* about a year (107 quotes, once every 3 days).

I love the old-school fantasy look of the text and I find it satisfying that it displays literal ancient wisdom.

Attribution

Font

Compass by somepx. I bought it, so I can't include it here. You can buy it and copy the file to the directory where you run the code or you can use any other font and it should work (maybe with some tweaks).

Tao Te Ching

You can download the pdf of the book from the author's website https://www.caroldeppe.com/. The PDF also mentions it's okay to share the PDF so I included it as well as the txt version of the "Master/she" section for the Python code.