Skip to main content

Directory content dumping utility

Project description

rootdump

PyPI version Python Versions License: MIT

A Python library for dumping directory contents into a single organized text file. Perfect for code reviews, documentation, and project analysis.

Features

Tree Structure - Displays directory structure in a tree format
📝 Content Dump - Dumps the content of all text files
🔍 Extension Filtering - Filter files by extension
Binary Detection - Automatically excludes binary files
🔢 Line Numbers - Includes line numbers with a separator for easy reading.

Installation

pip install rootdump

Quick Start

Command Line Usage

Basic usage:

rootdump /path/to/source output.txt

With options:

# Exclude binary files
rootdump /path/to/source output.txt --exclude-binary

# Include only specific extensions
rootdump /path/to/source output.txt --extensions .py .txt .md

# Skip directory tree structure
rootdump /path/to/source output.txt --no-tree

# Exclude line numbers from the output
rootdump /path/to/source output.txt --no-line-numbers

Python API

from rootdump import dump_directory

# Basic usage
dump_directory("source_dir", "output.txt")

# With options
dump_directory(
    "source_dir",
    "output.txt",
    exclude_binary=True,
    include_extensions=[".py", ".txt"],
    show_tree=True,
    show_line_numbers=True
)

Output Example

# Directory structure:
# .
# ├── src/
# │   ├── __init__.py
# │   └── main.py
# ├── tests/
# │   └── test_main.py
# └── README.md

## src/__init__.py

1 | def hello():
2 |     print("Hello from src/__init__.py")

## src/main.py

1 | def main():
2 |     print("Hello from src/main.py")
3 |
4 | if __name__ == "__main__":
5 |     main()

Contributing

Contributions are welcome! Feel free to:

  • Report issues
  • Suggest features
  • Submit pull requests

Acknowledgments

This project was inspired by uithub.com's project structure visualization.

License

This project is licensed under the MIT License - see the LICENSE file 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

rootdump-0.1.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

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

rootdump-0.1.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file rootdump-0.1.2.tar.gz.

File metadata

  • Download URL: rootdump-0.1.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for rootdump-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e40084a4863f35dd1cd53e471d356170a7cb227fa506e3774b6ba8d40ffa145c
MD5 99078d1ba904c2daf1a1913d8c126e20
BLAKE2b-256 1edf9b9529ea0ce635ea3f6174f6cd17d516bc331fda04ec18af6749e5fd8833

See more details on using hashes here.

File details

Details for the file rootdump-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rootdump-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for rootdump-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22d383cee007955608c6b570557b21856a92087a9a131bcb3092e34cf9b34dab
MD5 0dee86cbc724f39ddbd92fffd22a2960
BLAKE2b-256 d4737743ed3d44cd6133532ecff80bfaadf232003255545385a23e30e67d2618

See more details on using hashes here.

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