Skip to main content

Progressive Formalization for Markdown using Pydantic and Pytest

Project description

Typedown Logo Typedown: Markdown that scales

Visit Official Website »

License: MIT Python 3.12+ Linter: Ruff

English | 简体中文

Typedown evolves your team's documentation into a validated knowledge base. It brings the rigor of code to the fluidity of natural language.

"Docs that don't rot."

The Problem: Markdown Doesn't Scale

Markdown is the universal standard for technical documentation. But as your repository grows from 10 to 10,000 files, it becomes a "Write-Only" graveyard:

  • Links Break: Moving a file requires grep and prayer.
  • Data Drifts: "Status: Active" vs "status: active" vs "Status: ON".
  • Context Decays: The implicit model in your head isn't enforced in the text.

The Solution: Typedown

Typedown transforms your documentation repository into a Database. It adds a semantic layer to Markdown, allowing it to "phase transition" from loose text to structured data.

1. Structure (Schema)

Define what your data should look like using Python (Pydantic).

<!-- Defined in a code block -->

```model:User
class User(BaseModel):
    name: str
    role: Literal["admin", "member"]
```

2. Space (Graph)

Use Solid References that never break. Typedown resolves links by Content Hash (L0), Handle (L1), or Global ID (L2).

This report is authored by [[users/alice]].

3. Logic (Validation)

Enforce invariants directly in your documentation. Ensure your architecture rules are respected.

```spec
def check_admin_policy(user: User):
    if user.role == "admin":
        assert user.has_mfa, "Admins need MFA"
```

Installation

Typedown is designed to be used primarily in your editor, backed by a powerful CLI.

1. Editor Integration (Recommended)

For the true "Write-and-Validate" experience, install the VS Code extension:

2. Global CLI (For CI/CD)

Verify your knowledge base in CI pipelines using uv (recommended) or pip:

# Instant run (no install needed)
uvx typedown check

# Install globally
uv tool install typedown

3. For Contributors

If you want to hack on the compiler itself:

git clone https://github.com/IndenScale/typedown.git

Core Philosophy

Typedown is built on the concept of Consensus as Code (CaC).

  • Markdown (The Interface): Humans and LLMs speak natural language.
  • Pydantic (The Structure): Machines need schemas.
  • Pytest (The Law): Systems need invariants.

We call this "Literate Modeling"—you don't leave the document to define the system; the document is the system.

Documentation


License

MIT © IndenScale

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typedown-0.2.17.tar.gz (802.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typedown-0.2.17-py3-none-any.whl (89.4 kB view details)

Uploaded Python 3

File details

Details for the file typedown-0.2.17.tar.gz.

File metadata

  • Download URL: typedown-0.2.17.tar.gz
  • Upload date:
  • Size: 802.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for typedown-0.2.17.tar.gz
Algorithm Hash digest
SHA256 4d32d4a33ba23da75acfe0b3d31f9777d69a7268482a9439da2fb7964df4ae8e
MD5 628fe64998f4e6308e807a2337d4aa5c
BLAKE2b-256 d0fc94a2c0d9df0a88f0352e3fff5a10e77849fa60d294b615e7d1db26ceb643

See more details on using hashes here.

Provenance

The following attestation bundles were made for typedown-0.2.17.tar.gz:

Publisher: publish-pypi.yml on IndenScale/Typedown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file typedown-0.2.17-py3-none-any.whl.

File metadata

  • Download URL: typedown-0.2.17-py3-none-any.whl
  • Upload date:
  • Size: 89.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for typedown-0.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 b329062e4e7b11739ebb2878aaa0c2546fa4d6bef9054726091ee8b951c04a58
MD5 a38e381a454b4095cb4026e5f300d0a6
BLAKE2b-256 3b55270da4ccc356fa69522b7a36fb2ccb160c2c6f8378be947b92619a99d1c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for typedown-0.2.17-py3-none-any.whl:

Publisher: publish-pypi.yml on IndenScale/Typedown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page