Skip to main content

haystack-pydoc-tools

PyPI - Version PyPI - Python Version


Tool to generate Docusaurus-compatible Markdown API references from Python docstrings. It uses griffe to parse source code and griffe2md to render the output.

Installation

pip install haystack-pydoc-tools

Usage

The tool reads YAML configuration files and generates Markdown API docs.

Process a single config file:

haystack-pydoc config.yml [output-directory]

Process a directory of config files (in parallel):

haystack-pydoc pydoc/ output/

A pydoc-markdown alias is also available for backward compatibility.

Output behavior

Each config must specify a filename. By default, the file is written in the current working directory; if an output directory is provided, the file is written there instead.

Configuration

Each .yml file describes which modules to document and how to render the output.

Minimal example

loaders:
  - search_path: [src]
    modules:
      - haystack.components.generators.chat.openai
      - haystack.components.generators.chat.azure
renderer:
  title: Generators
  id: generators-api
  description: Enables text generation using LLMs.
  filename: generators_api.md

Full example

loaders:
  - search_path: [../src]
    modules:
      - haystack.components.generators.chat.openai
      - haystack.components.generators.chat.azure
processors:
  - type: filter
    documented_only: false    # include objects without docstrings
    skip_empty_modules: false  # keep modules even if they have no content
renderer:
  title: Generators API
  id: generators-api
  description: Enables text generation using LLMs.
  filename: generators_api.md

When the processors section is omitted, defaults apply: documented_only: true, skip_empty_modules: true.

Legacy example

The tool also accepts the older pydoc-markdown-style configs. Most fields are ignored but don't cause errors.

loaders:
  - type: haystack_pydoc_tools.loaders.CustomPythonLoader  # ignored
    search_path: [../src]
    modules:
      - haystack.components.generators.chat.openai
      - haystack.components.generators.chat.azure
    ignore_when_discovered: ["__init__"]  # ignored
processors:
  - type: filter
    expression:              # ignored
    documented_only: true
    do_not_filter_modules: false  # ignored
    skip_empty_modules: true
  - type: smart    # ignored
  - type: crossref  # ignored
renderer:
  type: haystack_pydoc_tools.renderers.DocusaurusRenderer  # ignored
  title: Generators API
  id: generators-api
  description: Enables text generation using LLMs.
  markdown:
    descriptive_class_title: false   # ignored
    classdef_code_block: false       # ignored
    descriptive_module_title: true   # ignored
    add_method_class_prefix: true    # ignored
    add_member_class_prefix: false   # ignored
    filename: generators_api.md

License

haystack-pydoc-tools is distributed under the terms of the Apache-2.0 license.

Release process

To release version x.y.z:

  1. Manually update the version in src/haystack_pydoc_tools/__about__.py (via a PR or a direct push to main).
  2. From the main branch, create a tag locally: git tag vx.y.z.
  3. Push the tag: git push --tags.
  4. Wait for the CI to release the package on PyPI.

Metadata

Release files for haystack-pydoc-tools 0.7.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 haystack-pydoc-tools 0.7.0
File Size Uploaded
haystack_pydoc_tools-0.7.0.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for haystack-pydoc-tools 0.7.0
File Interpreter ABI Platform
haystack_pydoc_tools-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.1 kB

Release files / haystack_pydoc_tools-0.7.0.tar.gz

Download URL haystack_pydoc_tools-0.7.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ef23eef95baae3fcbd73ad6e8cf3c0ae757c301437a3a540fde4aa322d9f4e6f
BLAKE2b-256 checksum
How to use checksums
cf2d1173be4a621a4c1e1bfd87079ec37c29ab25953b7c0e359f682f19c2c45b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.12.3 HTTPX/0.28.1

Release files / haystack_pydoc_tools-0.7.0-py3-none-any.whl

Download URL haystack_pydoc_tools-0.7.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96bcc6c304f6657829c54de1def7904764c9afd04b6e3261ff0d8f3b7f09a301
BLAKE2b-256 checksum
How to use checksums
9fdb12d03aff7ad47286d20c414738fd029829b06e53024f9e9c05356af00ee5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.12.3 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

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