Skip to main content

A utility for recursively listing and saving the content of source code files

Project description

Files Lister

Files Lister is a Python utility designed to recursively list and save the content of source code files in a directory structure. It offers flexible options for including or excluding files based on various criteria, making it a handy tool for developers who need to manage and review project files efficiently.

Features

  • Recursively list files within directory structures
  • Option to include or exclude hidden files and directories
  • Filter files by specific extensions (e.g., .txt, .py)
  • Skip specified directories and file patterns
  • Output full or relative file paths
  • Save file contents to an output file
  • Automatic removal of empty lines from output (optional)

Installation

To install Files Lister, ensure you have Python 3.9 or later and pipx installed. You can install pipx via:

brew install pipx
pipx ensurepath

Then, install Files Lister:

pipx install files-lister

This will make the files-lister command available globally on your system.

Usage

To use Files Lister, execute the following command:

files-lister [OPTIONS]

Options:

-f, --files_and_dirs: File/directory or list of them to process (required)

-i, --include_hidden: Include hidden files and directories

-x, --include_extension: Include only files with specified extensions (e.g., '.txt' '.py')

-d, --skip_dirs: Additional directories to skip

-r, --remove_empty_lines: Keep empty lines in output (by default, empty lines are removed)

-s, --skip_files: Files or file patterns to skip

-q, --quiet: Do not print output to console

--full_path: Print full path instead of relative path

Example Command:

To list all Python files in the current directory, excluding venv and build directories, and skipping init.py files:

files-lister -f "." -x ".py" -d "venv" "build" -s "__init__.py"

Output

The command generates a file named files_output in the current directory, containing the list of files and their contents.

License

Files Lister is licensed under the MIT License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request on GitHub.

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

files_lister-0.2.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

files_lister-0.2.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file files_lister-0.2.1.tar.gz.

File metadata

  • Download URL: files_lister-0.2.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for files_lister-0.2.1.tar.gz
Algorithm Hash digest
SHA256 001652dec126b47c92bfc897c01adf93a821998eb1d30b1d5dcb3fd08a23158e
MD5 3887b4acc169f8574be4507eb0ef0e26
BLAKE2b-256 ab2c6f3b5acea5729dff9b88198b5897c62bc4e820298192fc63a8e10dd3a68b

See more details on using hashes here.

File details

Details for the file files_lister-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: files_lister-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.18

File hashes

Hashes for files_lister-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c16ce55108f3451182199818bed32ceb1e3240a499e556edfb37142234028e32
MD5 3f9215be0a7b55b839591f94f0113d17
BLAKE2b-256 a6c5908f570d998f5bbd2e649e40d9c05e00720602e1f02650fd0a7da6286124

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