tidypress
On this page

Python wrapper

Use TidyPress from Python and run Python-native helper commands.

The Python package provides a tidypress entrypoint for Python environments.

Rendering still uses the Node.js CLI and Astro engine. Node.js 22.12 or newer is required for init, dev, build, preview, deploy, and context.

Install

pip install tidypress

For site commands, the wrapper resolves the Node CLI in this order:

  1. TIDYPRESS_CLI_JS
  2. a local monorepo or project node_modules/tidypress
  3. tidypress on PATH

It does not use npx by default. TIDYPRESS_USE_NPX=1 is available as an explicit escape hatch.

Site commands

These commands are delegated to the Node CLI (same surface as npx tidypress):

tidypress init [--preset lab|blog|persona|docs-writing|custom]
tidypress dev
tidypress build
tidypress preview
tidypress clean
tidypress deploy
tidypress context [output.md]
tidypress import devto <url-or-slug>
tidypress doctor
tidypress migrate-sections
tidypress add-version <label>

import devto fetches real markdown. Other import providers write review scaffolds. Experimental Node commands (editor, export, ai) forward when enabled in config.

Notebook conversion

convert is Python-native:

tidypress convert analysis.ipynb

By default, output goes to:

docs/src/content/docs/analysis.mdx

You can choose the output file:

tidypress convert analysis.ipynb --output docs/src/content/docs/reports/analysis.mdx

The converter preserves markdown cells, code cells, text outputs, and PNG image outputs.

Source extraction

extract-docs writes a simple API notes file from Python, TypeScript, or Go comments:

tidypress extract-docs src/ --lang py
tidypress extract-docs src/ --lang ts
tidypress extract-docs src/ --lang go

Default output:

docs/src/content/docs/api/<lang>.md

This is a convenience helper for small projects. For large API references, keep using the dedicated tooling for that ecosystem.

Agents and markdown

Agents that edit files in git use the same commands as you do: add markdown under src/content/, run tidypress build, deploy build/. Export tidypress context when the model needs a map of existing pages. Details: Agents and markdown.

Help and init presets

tidypress --help
tidypress init --help

The Python entrypoint lists the same init presets as the Node CLI (lab, blog, persona, docs-writing, custom). default is an alias for lab.

Streaming build and deploy

tidypress build and tidypress deploy stream Node CLI output live through an async subprocess. Add --sync to use the legacy blocking runner (for scripts that capture output).

YAML bridge

tidypress.yaml is validated against the shared JSON Schema from @tidypress/config before Python commands read bridged flags.

The wrapper can read tidypress.yaml or tidypress.yml:

python:
  convert:
    input_path: analysis.ipynb
    output_path: docs/src/content/docs/analysis.mdx

Run with an explicit config:

tidypress convert --config ./tidypress.yaml