Skip to main content

Easily zip your codebase while excluding unnecessary files like a pro! Say goodbye to bloated archives and hello to clean, lightweight packages. ๐ŸŽ‰

Project description

๐Ÿ“ฆ CodePackager โ€” The Ultimate Code Packaging Tool ๐Ÿš€

Easily zip your codebase while excluding unnecessary files like a pro! Say goodbye to bloated archives and hello to clean, lightweight packages. ๐ŸŽ‰

โœจ Features

  • ๐ŸŽฏ Multiple Presets: Choose from 4 built-in presets for different packaging needs

    • basic: Exclude common build files and caches
    • git-friendly: Keep .git directory but exclude large files
    • complete: Exclude all unnecessary files including .git
    • lightweight: Keep only core source code
  • ๐Ÿงน Smart Comment Removal: Remove comments from Python, JavaScript, Java, C/C++ files

  • ๐Ÿ—œ๏ธ Multiple Compression Methods: Support for deflate, lzma, and bzip2 compression

  • ๐Ÿ“Š Detailed Statistics: Get comprehensive packaging statistics

  • ๐ŸŒ Cross-Platform: Works seamlessly on Windows, macOS, and Linux

  • โšก Fast & Efficient: Optimized for large codebases with blazing-fast execution

๐Ÿค” Why Use PackMyCode?

When working with large codebases, manual packaging can be a nightmare. PackMyCode simplifies the process by:

  • Automatically skipping files you don't need (e.g., node_modules, *.log, __pycache__)
  • Providing flexible preset configurations for different scenarios
  • Offering advanced features like comment removal and multiple compression methods
  • Keeping your archives clean and deploy-ready
  • Saving time and reducing human errors

๐Ÿš€ Quick Start

Usage

You can run pack-my-code directly using uvx without installation:

uvx pack-my-code

Or install it first:

# Install via pip
pip install pack-my-code

# Install via uv (recommended)
uv tool install pack-my-code

Once installed, you can use the pack-my-code command directly:

# Run TUI (Terminal User Interface)
pack-my-code

# Run CLI (Command Line Interface)
pack-my-code --source . --output code_package.zip

Development Setup

  1. Clone the repository

    git clone https://github.com/Deali-Axy/code-packager.git
    cd code-packager
    
  2. Sync dependencies

    uv sync
    
  3. Run from source

    # Run TUI
    uv run pack-my-code
    
    # Run CLI
    uv run pack-my-code --source . --output output.zip
    

๐Ÿ“‹ Command Line Options

Usage: pack-my-code [OPTIONS] [SOURCE_DIR] [OUTPUT_ZIP]

Arguments:
  SOURCE_DIR    Source code directory to package
  OUTPUT_ZIP    Output zip file path

Options:
  -p, --preset PRESET       Choose preset: basic, git-friendly, complete, lightweight (default: basic)
  -c, --config CONFIG       Use custom configuration file
  -r, --remove-comments     Remove comments from source code files
  --compression METHOD      Compression method: deflate, lzma, bzip2 (default: deflate)
  -l, --list-presets        List all available presets
  -v, --verbose             Show detailed output
  -h, --help                Show help message

๐Ÿ“‚ Preset Configurations

Preset Description Use Case
basic Excludes common build files, caches, and IDE files General development projects
git-friendly Keeps .git directory but excludes large objects Sharing projects with version history
complete Excludes everything unnecessary including .git Final release or distribution
lightweight Keeps only essential source code Minimal code sharing

๐Ÿ“‚ Example Directory Structure

Before packaging:

project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ helpers.py
โ”œโ”€โ”€ node_modules/          # Excluded
โ”œโ”€โ”€ __pycache__/          # Excluded
โ”œโ”€โ”€ build/                # Excluded
โ”œโ”€โ”€ .git/                 # Depends on preset
โ”œโ”€โ”€ .vscode/              # Excluded
โ””โ”€โ”€ .gitignore

After packaging (basic preset):

code_package.zip
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ helpers.py
โ”œโ”€โ”€ .git/
โ””โ”€โ”€ .gitignore

๐Ÿ”ง Advanced Features

Comment Removal

Supports removing comments from:

  • Python (.py)
  • JavaScript (.js, .jsx, .ts, .tsx)
  • Java (.java)
  • C/C++ (.c, .cpp, .h, .hpp)

Custom Configuration

Create your own exclusion rules by using the --config option with a custom configuration file.

Compression Methods

  • deflate: Fast compression, good compatibility (default)
  • lzma: Best compression ratio, slower
  • bzip2: Good balance between speed and compression

๐Ÿค Contributing

Contributions are welcome! Please feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

For bug reports and feature requests, please open an issue.

๐Ÿ“„ License

This project is licensed under the MIT License. See LICENSE for details.


Made with โค๏ธ by DealiAxy

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

pack_my_code-0.3.4.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

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

pack_my_code-0.3.4-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file pack_my_code-0.3.4.tar.gz.

File metadata

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

File hashes

Hashes for pack_my_code-0.3.4.tar.gz
Algorithm Hash digest
SHA256 af73d7006144f53ad95542a2cbb11d6cb03d6648056cbb28af430368eda4f6a1
MD5 790580f163f8353fc0b78895ef463556
BLAKE2b-256 4f80f62d4408fbccd4ff97a6ff6be066acf76063d361ea80ad148da6087c16c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pack_my_code-0.3.4.tar.gz:

Publisher: publish.yaml on star-plan/code-packager

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

File details

Details for the file pack_my_code-0.3.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pack_my_code-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1341b31d340028b18fb9dc6dcd651b951e740db42a265712dd9e58cf996f93cf
MD5 7db09c2b40523a1717b5d8bedb9adb27
BLAKE2b-256 8d3ee6a33234a0011614c891109d540866b268ff167ef809ed2473e57b832ab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pack_my_code-0.3.4-py3-none-any.whl:

Publisher: publish.yaml on star-plan/code-packager

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