Skip to main content

repo mapper

This repo provides a tool to generate and update a repo file structure map in a README file. It supports filtering files by extension, ignoring specified directories, and appending or replacing an existing file structure map.

features

  • Scans a directory and generates a file tree structure.
  • Allows filtering by file extensions.
  • Ignores specified directories.
  • Updates the target README file with the generated file tree.
  • Can be integrated with pre-commit hooks.

cli usage:

python -m repo_mapper <directory> <readme_path> [--allowed-extensions <ext1> <ext2> ...] [--ignore-dirs <dir1> <dir2> ...]

args

directory: The root directory to scan for files.

readme_path: Path to the README file to update.

--allowed-extensions: (Optional) List of file extensions to include in the map (e.g., .py, .yaml). Defaults to all files.

--ignore-dirs: (Optional) List of directory names to exclude from the map.

examples

generate a repo map including only Python files and YAML files:

python -m repo_mapper . ./docs/README.md --allowed-extensions .py .yaml

generate a repo map ignoring the tests directory

python -m repo_mapper . ./README.md --ignore-dirs tests

generate a repo map ignoring files that match patterns listed in the gitignore

python -m repo_mapper . ./README.md --use-gitignore

pre-commit integration - used for this repo

- id: repo_mapper
  name: repo_mapper
  entry: python -m repo_mapper . ./docs/README.md --use-gitignore --allowed-extensions .py .yaml .toml .md --ignore-dirs mock_data
  language: system

generated repo map

├── docs
│   └── README.md
├── src
│   └── repo_mapper
│       ├── __init__.py
│       ├── __main__.py
│       ├── io.py
│       └── utils.py
├── tests
│   ├── __init__.py
│   ├── conftest.py
│   └── test_utils.py
├── pyproject.toml
└── ruff.toml
::

Release files for repo-mapper 0.1.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 repo-mapper 0.1.0
File Size Uploaded
repo_mapper-0.1.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repo-mapper 0.1.0
File Interpreter ABI Platform
repo_mapper-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / repo_mapper-0.1.0.tar.gz

Download URL repo_mapper-0.1.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cc2cb2e31ef86ff93e90496f175771b06c41dbcd18c8f148342ea97a3a7dd1d8
BLAKE2b-256 checksum
How to use checksums
a0ad70dca4acc23e05c7f5a531aaf1aee91e249f1d067410871b7082127d1c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2025.

Transparency log

Release files / repo_mapper-0.1.0-py3-none-any.whl

Download URL repo_mapper-0.1.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1645d96b4a5dec5ea94276a718547238d6cac3869765a4040f351a1ddfb25b68
BLAKE2b-256 checksum
How to use checksums
1528f8654f2d9189e75096faf48e8a6174fcf90804e77ee325ea1f1085047abb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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