Skip to main content

codefold (Python)

PyPI

Python bindings for codefold, a structural code reader for LLM agents: Read, with zoom levels. Hand it a file and a level, get back only the slice of the file the model needs.

Languages: Python, TypeScript (incl. TSX/JSX), Rust, Go, Markdown.

Install

pip install codefold   # or: uv add codefold

Prebuilt abi3 wheels (Python 3.8+) for Linux, macOS and Windows.

Use

import codefold

r = codefold.read("src/auth.py", level="signatures")
print(r.content)
print(f"~{r.tokens_est} tokens, {len(r.symbols)} symbols, {r.language}")

# Keep `login` at full body, everything else as signatures.
r = codefold.read("src/auth.py", level="signatures", focus=["login"])

# Fold code you already have in memory (a buffer, a diff, stdin).
r = codefold.read_source(source, "typescript", level="public")

Levels

Level What you get
signatures (default) imports, constants, function/class signatures, docstring summaries; bodies elided
public signatures, filtered to the public surface (export, pub, uppercase Go, no _ prefix)
bodies top-level and method bodies in full, nested bodies collapsed
full the file verbatim

API

  • read(path, level="signatures", focus=None) -> FoldResult
  • read_source(source, language, level="signatures", focus=None) -> FoldResult; language is a name or extension ("python"/"py", "ts", "tsx", "rust", "go", "md")
  • FoldResult: content, symbols, hidden_ranges, language, tokens_est
  • Symbol: name, kind (function, method, class, import, section), byte_start, byte_end, line_start, line_end

Errors: FileNotFoundError for unreadable paths, ValueError for an unknown level or language.

MIT licensed. Docs and CLI: https://codefold.maxenceleguery.net.

Metadata

Release files for codefold 0.9.0

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

Source distribution (sdist)

Source distribution for codefold 0.9.0
File Size Uploaded Provenance Actions
codefold-0.9.0.tar.gz 52.5 kB With provenance Details for codefold-0.9.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for codefold 0.9.0
File Actions
codefold-0.9.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for codefold-0.9.0-cp38-abi3-win_amd64.whl
codefold-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for codefold-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
codefold-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for codefold-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
codefold-0.9.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for codefold-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
codefold-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for codefold-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 13.1 MB

Release files / codefold-0.9.0.tar.gz

Download URL codefold-0.9.0.tar.gz
Size 52.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ab00c26054c4ac4096c06757558d2bc25f2085597b227182cf8184d6e8843bc7
BLAKE2b-256 checksum
How to use checksums
4a7319c4eff77cfa96cad0014f97643307e9e2ee03c2ac53203d9606f97f9b40
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 7, 2026.

Transparency log

Release files / codefold-0.9.0-cp38-abi3-win_amd64.whl

Download URL codefold-0.9.0-cp38-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
85d3d699d19f12f0ab61bbc289b64b224056c6606ea582192bd9b8fc704fbdf4
BLAKE2b-256 checksum
How to use checksums
c984cfec6db556d1e50ead63a56a8141f6a3e8091fb2ce36191a67131390f840
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 7, 2026.

Transparency log

Release files / codefold-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL codefold-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
390c5131c86e20e410049f08c73dc3f7cbddf6ccb69a26826484646a268e1ed9
BLAKE2b-256 checksum
How to use checksums
787ee53f3df9c370cfc9aa147413e925d00aa73c5ae06ac69e1147bd3de9eaf8
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 7, 2026.

Transparency log

Release files / codefold-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL codefold-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.7 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
edf3af1ab8ffb48e1119e31bd033a4a6dc19589a66cc63b57d50d02f2c5ee6f7
BLAKE2b-256 checksum
How to use checksums
45be8509c129307b4fa7ae2884351109fee55c3ffd36d580fa59ef42f8d1cc95
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 7, 2026.

Transparency log

Release files / codefold-0.9.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL codefold-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
Size 2.6 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5aa9d6aec99f9468ca659de1cfc42e61a4ac625b54011334b3c41bb1746e549a
BLAKE2b-256 checksum
How to use checksums
8ba28e74c08dfc440bb027987c4733bd936fe47e43bc368b91a2616298bad836
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 7, 2026.

Transparency log

Release files / codefold-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL codefold-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
52ad8936703bd1729023091b518fa464d611b06ed8b96c1ca7d6b4be316eed77
BLAKE2b-256 checksum
How to use checksums
6c551c7479d13fbc500add754ca5eb278b5e55ba2e804ff9321f256e15fa26f1
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 7, 2026.

Transparency log

Security for codefold 0.9.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for codefold-0.9.0.tar.gz

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 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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