Skip to main content

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

codecapsule-1.0.2.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

codecapsule-1.0.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file codecapsule-1.0.2.tar.gz.

File metadata

  • Download URL: codecapsule-1.0.2.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

Hashes for codecapsule-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f0cd35c3afcb4ad75cd896af646e7cadf1fb722f83cadadd78b080feca1aaae0
MD5 ba10a01a12b412f7d48774cd16c30002
BLAKE2b-256 497cc0aa4eb10cc9e3434d7fbab0432b4ece377a7e98253c67e6f8dde541d770

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecapsule-1.0.2.tar.gz:

Publisher: publish.yml on joshschmelzle/codecapsule

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

File details

Details for the file codecapsule-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: codecapsule-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for codecapsule-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b301a0f7a74fbf3d92d828b4390d5c3425dd641f51b7b3c6ed8d48552ccc135e
MD5 9d0aa19fea420a163a7db26d23ae79b2
BLAKE2b-256 d1fd12afe8f113bd0c8cd46d8919f43e12d86a1e6413a5101679c1129340e046

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecapsule-1.0.2-py3-none-any.whl:

Publisher: publish.yml on joshschmelzle/codecapsule

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