Skip to main content

Fumero

Generate a Fumadocs API reference from a Python module.

Fumero reads an importable module with griffe and writes a Fumadocs API reference: one page per module and one per class, alongside the React components that render them.

The reference is generated from the code. Signatures, type annotations and default values are read from the source, and the prose is taken from the docstrings. Nothing is restated by hand, so the reference cannot fall out of step with the code it documents.

Install

uv add fumero --dev  # or pip install fumero

Quick start

Install the components into the docs app that will render the output:

fumero init src/components/mdx

Register them once, so every generated page knows how to render itself:

// src/mdx-components.tsx
import defaultMdxComponents from 'fumadocs-ui/mdx';
import * as Pdx from '@/components/mdx/pdx-components';

export function getMDXComponents(components?: MDXComponents): MDXComponents {
  return { ...defaultMdxComponents, ...Pdx, ...components };
}

The loader plugin that came with them labels the sidebar entries that lead to a module:

// src/lib/source.ts
import { fumeroPlugin } from '@/components/mdx/pdx-plugin';

export const source = loader({
  plugins: [fumeroPlugin()],
  baseUrl: '/docs',
  source: docs.toFumadocsSource(),
});

A generated page carries its kind under _fumero, and Fumadocs keeps only the frontmatter its schema names, so let the rest through:

// source.config.ts
schema: pageSchema.loose(),

Then document a module:

fumero generate example --output content/docs/api --base-url /api --with-meta

A module is read from its source, not by importing it, so documenting a package does not run it. The exception is a module with no source to read, such as a C extension: that one is imported, and importing it runs whatever its module-level code does. Pass --no-inspect to read the .pyi stubs beside the binary instead, and nothing is imported at all.

Configuration

Every option is a flag on fumero generate and a key in a [tool.fumero] table. Options that do not change between runs belong in pyproject.toml:

[tool.fumero]
output = "content/docs/api"
base-url = "/api"
exclude = ["example.internal", "*.tests"]
with-meta = true

A flag overrides the file, which overrides the defaults.

Documentation

The full documentation lives at here. Fumero documents itself, so the API reference there is a working example of the output as much as it is a reference.

Development

This project uses devenv to manage the development environment. It sets up Python, uv, and everything else you need.

# Install devenv if you haven't already
# https://devenv.sh/getting-started/

# Enter the dev shell - this installs all dependencies automatically
devenv shell

Once you are in the shell, lint, type check, and test with:

uv run ruff check
uv run ty check
uv run pytest

Metadata

Release files for fumero 0.4.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 fumero 0.4.2
File Size Uploaded Provenance Actions
fumero-0.4.2.tar.gz 42.9 kB Without provenance Details for fumero-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fumero 0.4.2
File Interpreter ABI Platform Actions
fumero-0.4.2-py3-none-any.whl Python 3 none any Details for fumero-0.4.2-py3-none-any.whl

Total release size: 93.9 kB

Release files / fumero-0.4.2.tar.gz

Download URL fumero-0.4.2.tar.gz
Size 42.9 kB
Tags Source
SHA-256 checksum
How to use checksums
066de3c231eea8f9e781212bc8f1455a3c70b59f35e712009c05f19d4629414b
BLAKE2b-256 checksum
How to use checksums
abd0b57df4c8dbb28c8c1124f7819da18f236b67922e35a51f9a67b412e330ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fumero-0.4.2-py3-none-any.whl

Download URL fumero-0.4.2-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8db2dd69231363bd6e0ab99f21d42a0a7cde0468b314f2d6ded01a2d1cce0dbe
BLAKE2b-256 checksum
How to use checksums
5c092da7acebfadd4e18fec9b17c3e09943b71358e4160fe91d262d693086ed6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fumero 0.4.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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