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.3.tar.gz (17.2 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.3-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rootdump-0.1.3.tar.gz
  • Upload date:
  • Size: 17.2 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.3.tar.gz
Algorithm Hash digest
SHA256 7a6b0c8b25ffdcfb440790db4ba85f9cce2fa676830cabccbd8533c2a765eb99
MD5 17ca7d89fdf88a53e147d217bc1e3b57
BLAKE2b-256 08026cffc89461329416f23c3b1280922d1c07326197ee9e6bd1f65297c3e406

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rootdump-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4adacd6509604e1ff33e182cd2825ae2dcfda53e46e5931ea317f359f7516fd5
MD5 1bec2cdc07d6f1e6a61b26191c3d1c34
BLAKE2b-256 268f63906086b4e99cdd04cba0ddc274d0f1f7173d99cf0e54a4c7c611002823

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