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 passpandoc_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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a55a42f4ec5257e5ab20717a7e221fd819a89b118a8f29205ee84975b96d0a02
|
|
| MD5 |
a7393f39d9855b9fcbb1360f0b92a1d9
|
|
| BLAKE2b-256 |
c93b2f7ae3b8de8c74ddde072e6411359b3aebb8565aaefbb28de0347967fd64
|
Provenance
The following attestation bundles were made for repo2word-0.0.1.tar.gz:
Publisher:
publish-pypi.yaml on voorhs/repo2word
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repo2word-0.0.1.tar.gz -
Subject digest:
a55a42f4ec5257e5ab20717a7e221fd819a89b118a8f29205ee84975b96d0a02 - Sigstore transparency entry: 1869283948
- Sigstore integration time:
-
Permalink:
voorhs/repo2word@0982552120543007cf4b6cec57c9cc6bcc903f80 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/voorhs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@0982552120543007cf4b6cec57c9cc6bcc903f80 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aedd3812b580d5e2809e60803a320fcd38c978902b30c5192f56bca04c90e72
|
|
| MD5 |
685267d5a5aeeb1028f56399808d4324
|
|
| BLAKE2b-256 |
795a733b050a2c51bf09956b0a53252541c1e71c7eceb5e7c00607cf669819ca
|
Provenance
The following attestation bundles were made for repo2word-0.0.1-py3-none-any.whl:
Publisher:
publish-pypi.yaml on voorhs/repo2word
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repo2word-0.0.1-py3-none-any.whl -
Subject digest:
6aedd3812b580d5e2809e60803a320fcd38c978902b30c5192f56bca04c90e72 - Sigstore transparency entry: 1869284083
- Sigstore integration time:
-
Permalink:
voorhs/repo2word@0982552120543007cf4b6cec57c9cc6bcc903f80 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/voorhs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@0982552120543007cf4b6cec57c9cc6bcc903f80 -
Trigger Event:
release
-
Statement type: