Metadata-Version: 2.4
Name: py2fern
Version: 0.1.6
Summary: Generate Fern documentation from Python packages using static analysis.
Keywords: python,documentation,fern,api,static-analysis
Author-email: Ryan Stephen <ryanstep@buildwithfern.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
License-File: LICENSE
Requires-Dist: astroid>=2.7,<4
Requires-Dist: tomli; python_version<'3.11'
Requires-Dist: typing-extensions
Requires-Dist: typer[all]
Requires-Dist: PyYAML
Requires-Dist: docstring-parser>=0.15
Requires-Dist: pytest ; extra == "testing"
Requires-Dist: pytest-regressions ; extra == "testing"
Requires-Dist: pytest-cov ; extra == "testing"
Requires-Dist: PyYAML ; extra == "testing"
Requires-Dist: types-PyYAML ; extra == "testing"
Project-URL: Home, https://github.com/fern-api/py2fern
Provides-Extra: testing

# py2fern

Generate [Fern](https://buildwithfern.com) API documentation from Python packages using static analysis.

Simplified fork of [`sphinx-autodoc2`](https://github.com/sphinx-extensions2/sphinx-autodoc2) focused purely on **Python → Fern markdown** output.

## Installation

```bash
pipx install py2fern
```

## Upgrading

To upgrade to the latest version:

```bash
pipx upgrade py2fern
```

Or if installed with pip:

```bash
pip install --upgrade py2fern
```

Check your current version:

```bash
py2fern --version
```

## Usage

Generate Fern markdown documentation:

```bash
py2fern write /path/to/your/package
```

Specify output directory:

```bash
py2fern write /path/to/your/package --output ./docs/api
```

### Debug Mode

Show warnings for functions missing return type annotations:

```bash
py2fern write /path/to/your/package --output ./docs/api --debug
```

Warnings appear in yellow and help identify functions that should have type annotations added.

### Legacy Parser Mode

Use the old regex-based parser instead of the default `docstring_parser`:

```bash
USE_REGEX_PARSER=1 py2fern write /path/to/your/package --output ./docs/api
```

### Output

This creates:
- **MDX files** with Fern-compatible frontmatter and slugs
- **`navigation.yml`** for Fern docs structure
- **Consistent ParamFields** for all Parameters and Returns sections

## Acknowledgments

This project is a fork of the excellent [`sphinx-autodoc2`](https://github.com/sphinx-extensions2/sphinx-autodoc2) by Chris Sewell. All credit for the core functionality goes to the original project.

## Development

All configuration is mainly in `pyproject.toml`.

Use [tox](https://tox.readthedocs.io/en/latest/) to run the tests.

```bash
pipx install tox
tox -av
```

Use [pre-commit](https://pre-commit.com/) to run the linters and formatters.

```bash
pipx install pre-commit
pre-commit run --all-files
# pre-commit install
```

[flit](https://flit.readthedocs.io/en/latest/) is used to build the package.

```bash
pipx install flit
flit build
```

