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
.gitignorepatterns 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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beb317d89f8b5db53d47030e247c64eccdd878e853140b31b489b307aaf952e6
|
|
| MD5 |
aaff257f3630e82dff924f12cd67429d
|
|
| BLAKE2b-256 |
3addf4bd6ebc7843f1f9879cae7e1e1fdb6349fef94823468b8955d0f8842c40
|
Provenance
The following attestation bundles were made for pakem-1.0.0.tar.gz:
Publisher:
publish.yml on YaronKoresh/pakem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pakem-1.0.0.tar.gz -
Subject digest:
beb317d89f8b5db53d47030e247c64eccdd878e853140b31b489b307aaf952e6 - Sigstore transparency entry: 953238751
- Sigstore integration time:
-
Permalink:
YaronKoresh/pakem@98df5103a04815242963a4f88286fb0f90ce6cc8 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/YaronKoresh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@98df5103a04815242963a4f88286fb0f90ce6cc8 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69013bbaefafd8c0f774ebe44da9f95ab59890a8fc90c3e0fbbaaf76c86a2bb6
|
|
| MD5 |
4b59b59b9f4fe59215e029c327a96081
|
|
| BLAKE2b-256 |
eead3ab3b6a7d6a1aff7d4421d8546d9c5d2526f12b6b9cb5662a3c6d2a633ce
|
Provenance
The following attestation bundles were made for pakem-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on YaronKoresh/pakem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pakem-1.0.0-py3-none-any.whl -
Subject digest:
69013bbaefafd8c0f774ebe44da9f95ab59890a8fc90c3e0fbbaaf76c86a2bb6 - Sigstore transparency entry: 953238756
- Sigstore integration time:
-
Permalink:
YaronKoresh/pakem@98df5103a04815242963a4f88286fb0f90ce6cc8 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/YaronKoresh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@98df5103a04815242963a4f88286fb0f90ce6cc8 -
Trigger Event:
release
-
Statement type: