RecurseReader CLI Utility
RecurseReader is a powerful and user-friendly command-line tool for recursively traversing directories to print file paths and their contents. It is designed with flexibility in mind, offering robust filtering and output options to suit a wide range of use cases.
Features 🚀
- Recursive Traversal: Walk through directories and list files along with their contents.
- Dot Directory Filtering: Optionally ignore directories starting with a dot (e.g.,
.git). - Hidden File Support: Choose whether to include hidden files (starting with a dot) in the output.
- Depth Limitation: Control how deep the traversal goes.
- Logging: Save the output to a log file for later review.
- Encoding Safety: Handle files with different encodings gracefully.
Installation 📦
Ensure you have Python 3.8+ installed on your system. Clone the repository and use the script directly:
git clone https://github.com/your-repo/recurse-reader.git
cd recurse-reader
python recurse_reader.py --help
Usage 🛠️
RecurseReader offers a variety of command-line arguments to customize its behavior. Here are some examples:
Basic Usage
Traverse a directory and display file paths and contents:
python recurse_reader.py /path/to/directory
Ignore Dot Directories
Skip directories that start with a dot:
python recurse_reader.py /path/to/directory --ignore-dot-dirs
Include Hidden Files
Include hidden files in the output:
python recurse_reader.py /path/to/directory --show-hidden-files
Limit Depth
Restrict the depth of traversal to two levels:
python recurse_reader.py /path/to/directory --max-depth 2
Log Output to File
Save the output to a log file:
python recurse_reader.py /path/to/directory --log-to-file output.log
Full Argument Reference 🗂️
usage: recursereader [-h] [--ignore-dot-dirs] [--show-hidden-files] [--max-depth MAX_DEPTH] [--gitignore GITIGNORE]
[--ignore-subfolders IGNORE_SUBFOLDERS [IGNORE_SUBFOLDERS ...]] [--log-to-file LOG_TO_FILE]
root_dir
Recursively print file paths and contents from a directory.
positional arguments:
root_dir The root directory to start the search.
options:
-h, --help show this help message and exit
--ignore-dot-dirs Ignore directories starting with a dot (e.g., '.git').
--show-hidden-files Include hidden files (files starting with a dot) in the output.
--max-depth MAX_DEPTH
Maximum depth to traverse (e.g., 2 for two levels deep).
--gitignore GITIGNORE
Path to a .gitignore-like file with patterns to ignore.
--ignore-subfolders IGNORE_SUBFOLDERS [IGNORE_SUBFOLDERS ...]
Specific subfolders to ignore (provide a space-separated list).
--log-to-file LOG_TO_FILE
Specify a file to log the output instead of printing to the console.
Example Output ✨
Here is what the output might look like when running RecurseReader:
Path: /example/project/README.md
Contents:
# Welcome to My Project
---
Path: /example/project/src/main.py
Contents:
print("Hello, World!")
---
License 📜
RecurseReader is licensed under the MIT License.
Contributing 🤝
We welcome contributions! Feel free to submit issues or pull requests to improve RecurseReader.
Metadata
Release files for recursereader 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| recursereader-0.0.1.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| recursereader-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / recursereader-0.0.1.tar.gz
| Download URL | recursereader-0.0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2a934b4b3924484c4860c9d2683aeb94bef7d75db88d542cd0e227917d49934
|
|
BLAKE2b-256 checksum How to use checksums |
6085aa58495efa688bdefe523b64ddac436cebdeb046220a51774ba24cd6524d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / recursereader-0.0.1-py3-none-any.whl
| Download URL | recursereader-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
810483397d9718df1f55f77b325768587e3092efef9a630870463747dbc9d9da
|
|
BLAKE2b-256 checksum How to use checksums |
5096130e7a2f097c0c15320e2e36710eb84445e44b84e98593c9ffacfc89e447
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for recursereader 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.