December Adventure Day 2

Published as part of 'December Adventure 2025' series.

I didn't write any code yesterday. Heck, I didn't even know what language I was going to use. Today I had to pick something.

I decided to use Python, mostly because of uv. It's really smooth. Python environments have felt fragile in the past, but now I have confidence everything's going to work and stay working.

The other contenders were Go, Rust, and a Scheme. I don't really like Go, but I use it at work a lot, so it's comfortable. Rust I like, but still don't feel like I could be as immediately productive as Python. If I get stuck on things to do I might rewrite parts in Rust for fun. Scheme? It's probably a good fit and my Python code often looks like someone who spent a lot of time writing Lisp. Maybe I'll do some rewrites in Chicken, too.

But, given Python, the next step was looking for a good library for futzing with ePub files. After giving epub-utils a spin, I had my winner.

I wrote a little script to kick the tires: take an ePub file and spit out the paths to each xhtml file in order. Not a big thing, just traversing the table of contents tree.

That's all I had time for in the morning.

Tomorrow I'll think about re-chunking the text from the xhtml files into the size I want. If a content file is too big, it should be split. If a content file is too small, it should be combined with a neighbor (and checked if that got too big). That should be a nice step.