Published July 13, 2025
If you've been following along I've become somewhat enamored of Cooklang and wrote a Python parser for it. When I did the initial release it was "good enough" but definitely not fully baked. I think it needs 1 more thing (plus some additional documentation) to actually get it there.
Today I did some work on it. I got it to print 1 3/4 if that's the amount instead of 7/4 which is how Python wants to print Fraction.
I also added string formatting, via a __format__ method to BaseObj (that covers Ingredient, Cookware, and Timing) as well as to
Quantity to give fine grained control of the string representation of these objects to the users.
What else do I think is needed:
Quantity object. We should be able to add, subtract, multiply, and divide them so that
if someone wants to add scaling the recipes they can.str and a BaseObj or Quantity to make string conversions easier.I think that about covers what should be in the 1.0 release. For now it's a great parser that will let you take a recipe written in Cooklang and format it however you want. If I was doing this as a "just for me" thing that would be enough. But I want this to be something that other people can use in their code to make other applications with it so it needs a bit more.
I will say that I will do one more release - hopefully in the next week or so - to get the improved fraction handling and the string formatting
out. That will be what I need to be able to publish a parser for render-engine that is flexible enough to be used by people other than me.
Version 1.0 is coming, and soon, but it still has a bit more work to be done.