Skip to main content

A tool for mapping directory structures

Project description

TreeMapper

A tool for converting directory structures to YAML format, designed for use with Large Language Models (LLMs). TreeMapper maps your entire codebase into a structured YAML file, making it easy to analyze code, document projects, and work with AI tools.

Build Status
PyPI
License

Installation

Requires Python 3.9+:

pip install treemapper

Usage

Generate a YAML tree of a directory:

# Map current directory
treemapper . 

# Map specific directory
treemapper /path/to/dir

# Custom output file
treemapper . -o my-tree.yaml

# Custom ignore patterns
treemapper . -i ignore.txt

# Disable all default ignores
treemapper . --no-default-ignores

Options

treemapper [OPTIONS] [DIRECTORY]

Arguments:
  DIRECTORY                    Directory to analyze (default: current directory)

Options:
  -o, --output-file FILE      Output YAML file (default: directory_tree.yaml)
  -i, --ignore-file FILE      Custom ignore patterns file
  --no-default-ignores        Disable all default ignores
  -v, --verbosity [0-3]       Logging verbosity (default: 0)
                             0=ERROR, 1=WARNING, 2=INFO, 3=DEBUG
  -h, --help                  Show this help

Ignore Patterns

By default, TreeMapper ignores:

  • The output file itself
  • All .git directories
  • Patterns from .gitignore files
  • Patterns from .treemapperignore file

Use --no-default-ignores to disable all default ignores and only use patterns from -i/--ignore-file.

Example Output

name: my-project
type: directory
children:
  - name: src
    type: directory
    children:
      - name: main.py
        type: file
        content: |
          def main():
              print("Hello World")
  - name: README.md
    type: file
    content: |
      # My Project
      Documentation here...

License

Apache License 2.0 - see LICENSE for details.

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

treemapper-1.0.2.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

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

treemapper-1.0.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file treemapper-1.0.2.tar.gz.

File metadata

  • Download URL: treemapper-1.0.2.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for treemapper-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e4ab12ba2569ab27b52216e58d32c35cb86549a91405085e898660b7a4fd4768
MD5 2501d2b180a6347dc302b832259d31dc
BLAKE2b-256 0c1c40c3a2caa789b7649b909eb57d6e16dc0908120aef892cb8e04b4c9ed99b

See more details on using hashes here.

Provenance

The following attestation bundles were made for treemapper-1.0.2.tar.gz:

Publisher: cd.yml on nikolay-e/TreeMapper

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

File details

Details for the file treemapper-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: treemapper-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for treemapper-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 342926856e8e96d07b824238ebbc7f65a85986a0aa3a509e1460fea62029d801
MD5 5af700de5ad0594aa82e8d8f8bc9a37d
BLAKE2b-256 8c7e4fd6b254c22dd99bbd80c63878b969dd8093497e83a3aa2b671497cbd5f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for treemapper-1.0.2-py3-none-any.whl:

Publisher: cd.yml on nikolay-e/TreeMapper

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