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

Installation & Run

You can run PackMyCode directly using uv without manual installation:

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

# Run CLI (Command Line Interface)
uvx --from . 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: uvx --from . 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.3.tar.gz (41.3 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.3-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pack_my_code-0.3.3.tar.gz
  • Upload date:
  • Size: 41.3 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.3.tar.gz
Algorithm Hash digest
SHA256 12d98d4490b8172955a2e9a9cbd0bf5977a261a634ab99db40e381ac9909bcf5
MD5 41f225e62992593a5d764593ed451f84
BLAKE2b-256 ae6d58aeb8118c23dcfe184c8a30f98a798ec4a2830971fea0d59a5e4b1458c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pack_my_code-0.3.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: pack_my_code-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 24.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e023baae5eed02d00cd6bd47f4e958990b317156d1522a8ebd1d5d58981ab5db
MD5 c77d3257c985fa48ba114fbd6f13105b
BLAKE2b-256 a7512f47862e7cb193b8c424512b52205e671a3e78fb46e9a6200f62b3d200f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pack_my_code-0.3.3-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