Skip to main content

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 .gitignore rules
  • 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:

  1. Generate knowledge for a repository:

    pk-extractor /path/to/your/repo
    
  2. Specify an output file:

    pk-extractor /path/to/your/repo --output_file my_knowledge.md
    
  3. Exclude specific patterns:

    pk-extractor /path/to/your/repo --exclude "*.pyc" "venv/*" "*.log"
    

Output

The script generates a markdown file containing:

  1. Project structure
  2. File contents

Development

To set up the development environment:

  1. Clone the repository:

    git clone https://github.com/your-username/pk-extractor.git
    cd pk-extractor
    
  2. 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

pk_extractor-0.2.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

pk_extractor-0.2.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pk_extractor-0.2.2.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

Hashes for pk_extractor-0.2.2.tar.gz
Algorithm Hash digest
SHA256 36cdf5fddd888a46c1889c20c887f1853d06a10ffb59911dcedd05f288fa9415
MD5 2a9e03e39f228bf8c9540a06bf93d933
BLAKE2b-256 4c9f89d03d631cf9a016f85ceed28cc31b3f846ba02283c995ff537eaf511319

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pk_extractor-0.2.2-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

Hashes for pk_extractor-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61983d0b331a4dc996647d2b45d126b3f974291de1dd00d67cea32fcbff0cc43
MD5 bc073a48796a0f4d1e41dfd0b279ef9f
BLAKE2b-256 535d11620ee19a24f67d86ac70665be59e31587520d0b1360acb1d547e083a2a

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