Skip to main content

cooklang-py

Tests Format and Lint CodeQL

A parser for the Cooklang recipe markup language

Installation

To install just run:

pip install cooklang-py

Documentation

Full documentation is available at https://cooklang-py.readthedocs.io/

Recipe

The Recipe is the primary unit. There are 2 ways to create a Recipe object:

from cooklang_py import Recipe

# Create from a string in memory
recipe_string = '<your recipe here>'
recipe = Recipe(recipe_string)

# Create from a file
recipe_file = '/path/to/recipe/file'
recipe = Recipe.from_file(recipe_file)

Just like a recipe in a book a Recipe contains:

  • Ingredients
  • Cookware / equipment
  • Timings
  • Metadata (servings, cook time, etc.)

To see how to define these in your input please refer to the Cooklang language specification

When the recipe is parsed there will be a list of Step objects. Each step object can contain:

  • Ingredients
  • Cookware
  • Timings
  • Instructions (text)

At both the Recipe and Step level you can access the list of Ingredients and Cookware for the recipe or step.

Cookware, Timings, and Ingredients

Cookware, timings, and ingredients are the backbone of the recipe. In this package all three inherit from the BaseObj. They all have the following 3 attributes:

  • name - the name of the item (i.e. pot, carrot, etc.)
  • quantity - how much is needed
  • notes - any notes for the item (i.e. "greased", "peeled and diced", etc.)
    • Timings do not have notes per the Cooklang specification.

Overriding implementations

The implementations of Cookware, Timings, and Ingredients can be overridden by creating a new implementation (inheriting from either that class or from BaseObj) and calling Recipe or Step with an updated prefixes dictionary that points the desired prefix to the new class.

Compatibility

cooklang-py passes all canonical tests defined at https://github.com/cooklang/cooklang-rs/blob/main/tests/canonical.yaml for the following platforms:

  • Linux
  • MacOS
  • Windows

Metadata

Release files for cooklang-py 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cooklang-py 1.0.2
File Size Uploaded
cooklang_py-1.0.2.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cooklang-py 1.0.2
File Interpreter ABI Platform
cooklang_py-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / cooklang_py-1.0.2.tar.gz

Download URL cooklang_py-1.0.2.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1c28a5a9355b2ec6fedd056b782b8ad34c356dddca8886d5f72dac406e08571c
BLAKE2b-256 checksum
How to use checksums
8367be6e8d5f9ec440ea2ab0f3d97030c8c4f5c6aca1a6e9f82a473db38876d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / cooklang_py-1.0.2-py3-none-any.whl

Download URL cooklang_py-1.0.2-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc31c86dfd5f9edd313d201b61ee898519d38bd6e63847bb4626a1faa3db5b1f
BLAKE2b-256 checksum
How to use checksums
5d94445a356df937c9126b0c9b58a3e8181868b2d3dc0de63ca5edbc7b28e295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page