Project Knowledge Extractor
Project description
pk-extractor
pk-extractor (Project Knowledge Extractor) is a tool that generates a comprehensive knowledge base from a given repository, including the project structure and file contents. It respects .gitignore rules and allows for additional exclusion patterns.
Features
- Generates a markdown file containing the project structure and file contents
- Respects
.gitignorerules - Allows for additional file/directory exclusion via command-line arguments
- Provides progress information during processing
- Handles binary files and errors gracefully
Installation
You can install pk-extractor using pip:
pip install pk-extractor
poetry add pk-extractor
Usage
After installation, you can run pk-extractor from the command line:
pk-extractor <root_dir> [--output_file OUTPUT_FILE] [--exclude [EXCLUDE [EXCLUDE ...]]]
or
pipx run pk-extractor <root_dir> [--output_file OUTPUT_FILE] [--exclude [EXCLUDE [EXCLUDE ...]]]
Arguments:
root_dir: Path to the repository you want to analyze (required)--output_file: Path to the output file (default: "knowledge.md")--exclude: Patterns to exclude (e.g., ".pyc" "venv/")
Examples:
-
Generate knowledge for a repository:
pk-extractor /path/to/your/repo -
Specify an output file:
pk-extractor /path/to/your/repo --output_file my_knowledge.md -
Exclude specific patterns:
pk-extractor /path/to/your/repo --exclude "*.pyc" "venv/*" "*.log"
Output
The script generates a markdown file containing:
- Project structure
- File contents
Development
To set up the development environment:
-
Clone the repository:
git clone https://github.com/your-username/pk-extractor.git cd pk-extractor -
Install dependencies:
poetry install
Now you can run the tool or tests within this environment.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pk_extractor-0.2.1.tar.gz.
File metadata
- Download URL: pk_extractor-0.2.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ea154c05533d244dd45c9f9d73f800351fa35499b123daf1c20d276b1c18e5f
|
|
| MD5 |
03e131308b45dba5fed09af7a8e5a8a1
|
|
| BLAKE2b-256 |
f9d8f5df0c61062c39abf1d4cf52e95996caf076054a45af1ecb597fb13f83b6
|
File details
Details for the file pk_extractor-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pk_extractor-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd58284f82a5a1cc42cc03f796a51d96171b856ae4ae1ffce5f7c85fba47b5cd
|
|
| MD5 |
daea9e3a67f38cf4938a9a8b760da3ba
|
|
| BLAKE2b-256 |
7ec3a3d3a0d9269ec694ea88a81cec015f0065115dbed3f63836e4e5afdf9260
|