Transform entire projects into portable JSON capsules for easy sharing and LLM processing
Project description
CodeCapsule 🚀📦
Overview
CodeCapsule is a powerful Python utility that transforms entire project directories into a single, portable JSON file. Perfect for sharing code with AI models, archiving projects, or creating compact code representations.
Features
- 🌐 Convert entire project structures to JSON
- 🧩 Supports multiple programming languages
- 🔍 Configurable file inclusion/exclusion
- 💡 Ideal for LLM code analysis and sharing
Installation
Install CodeCapsule using pip:
pip install codecapsule
Quick Start
Basic Usage
# Convert current project to JSON
codecapsule
# Convert a specific project directory
codecapsule /path/to/your/project
# Save to a specific output file
codecapsule /path/to/project -o project_capsule.json
Filtering and Handling
CodeCapsule provides robust file processing with the following features:
-
🚫 Automatically excludes:
- Binary files
- Large executables (
.exe,.dll,.so) - Compiled Python files (
.pyc) - Version control directories (
.git) - Virtual environments (
.venv) - Development databases
-
🔍 File Content Detection
- Uses UTF-8 encoding
- Skips files that cannot be decoded
- Detects binary files using null-byte heuristic
Example Output
[
{
"path": "src/main.py",
"content": "# Full contents of the Python file"
},
{
"path": "README.md",
"content": "# Project documentation"
}
]
Limitations
- Large files may impact performance
- Only text-based files are processed
- Some binary or complex file types are automatically excluded
Use Cases
- 📤 Sharing entire project contexts with AI models
- 🗄️ Lightweight project archiving
- 🔬 Code analysis and exploration
License
BSD-3 License - See LICENSE file for details.
Requirements
- Python 3.9+
- No external dependencies
Disclaimer
CodeCapsule is designed for code sharing and analysis. Always review JSON contents before sharing sensitive code.
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 codecapsule-1.0.3.tar.gz.
File metadata
- Download URL: codecapsule-1.0.3.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78f13ad93f501dff340b849935c976d5ab24b62124f24503f2293ee1d0bb5832
|
|
| MD5 |
6c043a2a0624b51d9f73de78f38a7d6d
|
|
| BLAKE2b-256 |
9e1fcf091ab33630c84f95911c76079852281ef1e793aef6594d358e343a4f07
|
Provenance
The following attestation bundles were made for codecapsule-1.0.3.tar.gz:
Publisher:
publish.yml on joshschmelzle/codecapsule
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codecapsule-1.0.3.tar.gz -
Subject digest:
78f13ad93f501dff340b849935c976d5ab24b62124f24503f2293ee1d0bb5832 - Sigstore transparency entry: 159404226
- Sigstore integration time:
-
Permalink:
joshschmelzle/codecapsule@df69640857a48ffa4f156f8fd8c5d5c875071a14 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/joshschmelzle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df69640857a48ffa4f156f8fd8c5d5c875071a14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codecapsule-1.0.3-py3-none-any.whl.
File metadata
- Download URL: codecapsule-1.0.3-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f2cea07658b6bb86ee75807ab30205a59df73e5a9826536910a6fe2ed49a25
|
|
| MD5 |
5fc1dfa179c7fadba51666c499843d7f
|
|
| BLAKE2b-256 |
d5ca095c0d1e5010663144e363e3a3555d012613de04315b6ede28734e6c8f96
|
Provenance
The following attestation bundles were made for codecapsule-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on joshschmelzle/codecapsule
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codecapsule-1.0.3-py3-none-any.whl -
Subject digest:
26f2cea07658b6bb86ee75807ab30205a59df73e5a9826536910a6fe2ed49a25 - Sigstore transparency entry: 159404227
- Sigstore integration time:
-
Permalink:
joshschmelzle/codecapsule@df69640857a48ffa4f156f8fd8c5d5c875071a14 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/joshschmelzle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df69640857a48ffa4f156f8fd8c5d5c875071a14 -
Trigger Event:
release
-
Statement type: