Skip to main content

A repository packer that generates XML representations of codebases

Project description

pakem

A repository packer that generates XML representations of codebases for use with LLMs and code analysis tools.

Features

  • Packs an entire repository into a single XML file
  • Respects .gitignore patterns and common ignore rules
  • Skips binary files automatically
  • Includes file metadata (size, tokens, line count)
  • Token counting for LLM context estimation

Installation

pip install pakem

Usage

Command Line

# Pack the current directory
pakem

# Pack a specific directory
pakem --path /path/to/repo

# Specify output file
pakem --path /path/to/repo --out output.xml

# Add additional ignore patterns
pakem --ignore "*.tmp" "secret_*"

You can also run it as a module:

python -m pakem --path /path/to/repo --out output.xml

Python API

from pakem import RepoPacker

packer = RepoPacker(
    root_dir="/path/to/repo",
    output_file="repo.xml",
    ignores=["*.tmp"]
)
packer.pack()

Development

Setup

git clone https://github.com/YaronKoresh/pakem.git
cd pakem
pip install -e ".[dev]"

Running Tests

pytest

Linting

ruff check .

License

This project is licensed under the GNU General Public License v3.0 - 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

pakem-1.0.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

pakem-1.0.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file pakem-1.0.0.tar.gz.

File metadata

  • Download URL: pakem-1.0.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pakem-1.0.0.tar.gz
Algorithm Hash digest
SHA256 beb317d89f8b5db53d47030e247c64eccdd878e853140b31b489b307aaf952e6
MD5 aaff257f3630e82dff924f12cd67429d
BLAKE2b-256 3addf4bd6ebc7843f1f9879cae7e1e1fdb6349fef94823468b8955d0f8842c40

See more details on using hashes here.

Provenance

The following attestation bundles were made for pakem-1.0.0.tar.gz:

Publisher: publish.yml on YaronKoresh/pakem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pakem-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pakem-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pakem-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69013bbaefafd8c0f774ebe44da9f95ab59890a8fc90c3e0fbbaaf76c86a2bb6
MD5 4b59b59b9f4fe59215e029c327a96081
BLAKE2b-256 eead3ab3b6a7d6a1aff7d4421d8546d9c5d2526f12b6b9cb5662a3c6d2a633ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pakem-1.0.0-py3-none-any.whl:

Publisher: publish.yml on YaronKoresh/pakem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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