read_pyfiles is a Python package for traversing directories, reading Python files, and outputting their contents to a single text file. It's configurable via a YAML file, making it easy to use in different scenarios.
- Traverse directories to locate
.pyfiles. - Combine file contents into a single output file.
- Configure paths and output file name via a YAML configuration.
To install the package locally, clone the repository and use pip:
git clone https://github.com/GSU-Analytics/read_pyfiles.git
cd read_pyfiles
pip install .If the repository is public and includes a setup.py, you can install it directly from GitHub:
pip install git+https://github.com/GSU-Analytics/read_pyfiles.gitThis will fetch the latest version of the code from the main branch and install it.
- Create a configuration file named
read_config.yaml:
output_file: "output.txt"
paths_to_read:
- "src"
- "tests"
- "main.py"- Run the tool using the command:
read_pyfilesThe output file will contain the combined contents of all .py files in the specified paths.
To set up a development environment:
- Clone the repository:
git clone https://github.com/GSU-Analytics/read_pyfiles.git
cd read_pyfiles- Install the package in editable mode:
pip install -e .- Run the tests:
pytest -vvThis project is licensed under the MIT License. See the LICENSE file for details.
We welcome contributions to improve this package. If you'd like to contribute, please:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of the changes.
For any questions or issues, please open an issue in the GitHub repository.