Skip to main content

Convert a Python package directory into a single syntax-highlighted Word (.docx) document.

Project description

repo2word

Convert a Python package directory (the folder that directly contains the root __init__.py) into a single Word (.docx) file: each *.py file is a section with a path heading, line numbers, and syntax-highlighted code.

Requirements

  • Python 3.14+
  • Pandoc installed and on your PATH (or pass pandoc_path= to the API)

On macOS: brew install pandoc. On Ubuntu/Debian: sudo apt-get install pandoc.

Installation

pip install repo2word

(or uv add repo2word). Pandoc is an external dependency and is not installed by pip — see Requirements.

Usage

from pathlib import Path
from repo2word import repo2word

repo2word(Path("path/to/mypackage"), Path("out.docx"))

path/to/mypackage must be the package root (it must contain __init__.py). The parent directory of the output .docx must already exist unless you pass mkdir_parents=True.

Development

uv sync --all-groups
uv run ruff check . && uv run ruff format .
uv run mypy .
uv run pytest

License

Apache-2.0

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

repo2word-0.0.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

repo2word-0.0.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file repo2word-0.0.1.tar.gz.

File metadata

  • Download URL: repo2word-0.0.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for repo2word-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a55a42f4ec5257e5ab20717a7e221fd819a89b118a8f29205ee84975b96d0a02
MD5 a7393f39d9855b9fcbb1360f0b92a1d9
BLAKE2b-256 c93b2f7ae3b8de8c74ddde072e6411359b3aebb8565aaefbb28de0347967fd64

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo2word-0.0.1.tar.gz:

Publisher: publish-pypi.yaml on voorhs/repo2word

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

File details

Details for the file repo2word-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: repo2word-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for repo2word-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6aedd3812b580d5e2809e60803a320fcd38c978902b30c5192f56bca04c90e72
MD5 685267d5a5aeeb1028f56399808d4324
BLAKE2b-256 795a733b050a2c51bf09956b0a53252541c1e71c7eceb5e7c00607cf669819ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo2word-0.0.1-py3-none-any.whl:

Publisher: publish-pypi.yaml on voorhs/repo2word

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