MCPcopy Index your code
hub / github.com/cooklang/cooklang-import

github.com/cooklang/cooklang-import @0.9.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.9.3 ↗ · + Follow
288 symbols 643 edges 52 files 61 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cooklang-import

A tool to import recipes into Cooklang format using AI-powered conversion. Hosted version runs via https://cook.md

Features

  • Multi-provider AI support: OpenAI, Anthropic Claude, Azure OpenAI, Google Gemini, and Ollama
  • Automatic fallback: Seamlessly switch between providers on failure
  • Smart extraction: JSON-LD, MicroData, HTML class extractors, and LLM fallback
  • Multiple input types: URLs, plain text, and images (via OCR)
  • Local AI support: Run completely offline with Ollama

See architecture.md for system design.

Installation

CLI

git clone https://github.com/cooklang/cooklang-import
cd cooklang-import
cargo install --path .

Rust Library

[dependencies]
cooklang-import = "0.8.6"

See docs/api-rust.md for library usage.

Mobile SDKs

Quick Start

Set your API key:

export OPENAI_API_KEY="your-api-key-here"

The tool works immediately with OpenAI's GPT-4.1-mini model.

Usage

URL to Cooklang

cooklang-import https://www.bbcgoodfood.com/recipes/next-level-tikka-masala

URL to Recipe (Extract Only)

cooklang-import https://www.bbcgoodfood.com/recipes/next-level-tikka-masala --extract-only

Text to Cooklang

cooklang-import --text "Take 2 eggs and 1 cup of flour. Mix and bake at 350°F for 30 minutes."

Image to Cooklang

Requires GOOGLE_API_KEY for OCR.

cooklang-import --image /path/to/recipe-photo.jpg

Options

cooklang-import --help                           # Full usage info
cooklang-import <url> --provider anthropic       # Use specific provider
cooklang-import <url> --timeout 60               # Custom timeout (seconds)

Configuration

Basic (config.toml)

cp config.toml.example config.toml
default_provider = "openai"

[providers.openai]
enabled = true
model = "gpt-4.1-mini"

[providers.anthropic]
enabled = true
model = "claude-sonnet-4.5"

[fallback]
enabled = true
order = ["openai", "anthropic"]

See docs/providers.md for all provider options.

Configuration Priority

  1. Environment variables (e.g., OPENAI_API_KEY)
  2. config.toml file
  3. Default values

Documentation

Document Description
architecture.md System design and project structure
docs/providers.md AI provider configuration
docs/api-rust.md Rust library API
docs/sdk-ios.md iOS/Swift SDK
docs/sdk-android.md Android/Kotlin SDK
docs/troubleshooting.md Common issues and solutions

Development

cargo test                              # Run tests
RUST_LOG=debug cooklang-import <url>    # Debug logging

Extension points exported contracts — how you extend this code

Converter (Interface)
(no doc) [5 implementers]
src/converters/mod.rs
Extractor (Interface)
(no doc) [3 implementers]
src/url_to_text/html/extractors/mod.rs

Core symbols most depended-on inside this repo

url_to_recipe
called by 39
src/lib.rs
build
called by 30
src/builder.rs
text
called by 27
src/builder.rs
decode_html_symbols
called by 22
src/url_to_text/html/extractors/json_ld.rs
url
called by 18
src/builder.rs
parse
called by 14
src/url_to_text/html/extractors/json_ld.rs
extract_only
called by 10
src/builder.rs
get_itemprop
called by 10
src/url_to_text/html/extractors/microdata.rs

Shape

Function 167
Method 60
Class 39
Enum 20
Interface 2

Languages

Rust100%

Modules by API surface

src/url_to_text/html/extractors/json_ld.rs39 symbols
src/builder.rs23 symbols
src/config.rs22 symbols
src/uniffi_bindings.rs20 symbols
tests/test_builder_api.rs15 symbols
src/pipelines/url.rs11 symbols
src/url_to_text/fetchers/page_scriber.rs10 symbols
src/converters/open_ai.rs9 symbols
tests/test_edge_cases.rs8 symbols
src/converters/ollama.rs8 symbols
src/url_to_text/text/extractor.rs7 symbols
src/url_to_text/html/extractors/html_class.rs7 symbols

For agents

$ claude mcp add cooklang-import \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact