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.2.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.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: files_lister-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0bf50a08b87806d040958399bd5a6ecc548b57632ecdb1e0bb19ac231e0996cb
MD5 c4ab8f90271cea29ab3f845b0b7040bb
BLAKE2b-256 33986fe225df5129bf9ceddd327cc51f3bd365f8cb5337745d87584d9c687508

See more details on using hashes here.

File details

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

File metadata

  • Download URL: files_lister-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 115c5264a064c949291c4decc423dd32e4552f386e14d31a69b097098af22418
MD5 5abf2e4f1a933100fe6a5cb35cbc4226
BLAKE2b-256 829d0bebf4e3959211dd4a0b9fba248bdd679d9d58a0d0bacc08abaabb3e7730

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