Metadata-Version: 2.5
Name: cleanzip
Version: 1.0.1
Summary: ZIP a project while respecting .gitignore — no Git required.
Project-URL: Homepage, https://github.com/subeesesh/rzip
Project-URL: Issues, https://github.com/subeesesh/rzip/issues
Author: cleanzip contributors
License-Expression: MIT
License-File: LICENSE
Keywords: archive,code-review,gitignore,packaging,zip
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Archiving :: Compression
Requires-Python: >=3.9
Requires-Dist: click>=8.0
Requires-Dist: pathspec>=0.11
Provides-Extra: dev
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# cleanzip

> ZIP a project while respecting `.gitignore` — no Git required.

**cleanzip** creates a clean ZIP archive of your project, automatically excluding every file and folder matched by your `.gitignore`. It works even when the project is **not** a Git repository and never shells out to `git`.

Perfect for sharing code with AI code reviewers, teammates, or archival — without dragging along `node_modules/`, `__pycache__/`, or `.env` files.

---

## Features

- 🚀 **Fast** — prunes ignored directories early, never walks into them.
- 🔒 **No Git dependency** — reads `.gitignore` directly with [`pathspec`](https://pypi.org/project/pathspec/).
- 🌍 **Cross-platform** — Windows, macOS, Linux.
- 🗂️ **Preserves structure** — directory tree inside the ZIP mirrors the project.
- 🦄 **Unicode-safe** — handles non-ASCII file names.
- 📦 **Minimal dependencies** — only `pathspec` + `click`.

---

## Installation

```bash
pip install cleanzip
```

Or install from source:

```bash
git clone https://github.com/subeesesh/rzip.git
cd rzip
pip install -e ".[dev]"
```

---

## Quick Start

### CLI

```bash
# Pack the current directory
cleanzip pack .

# Specify output name
cleanzip pack . -o project.zip

# See what would be included/excluded
cleanzip pack . --verbose

# Dry run — no ZIP created
cleanzip pack . --dry-run
```

### Python API

```python
from cleanzip import pack

# Basic usage
pack("my_project")

# With options
pack(
    project_path="my_project",
    output_zip="my_project.zip",
    verbose=True,
)

# Dry run
pack("my_project", dry_run=True)
```

---

## CLI Reference

```text
Usage: cleanzip pack [OPTIONS] PROJECT_PATH

  Pack a project directory into a ZIP archive.

Options:
  -o, --output PATH   Output ZIP file path. Defaults to <project_name>.zip.
  -v, --verbose        Show included and excluded files.
  --dry-run            List files without creating a ZIP.
  -h, --help           Show this message and exit.
```

---

## How It Works

1. Reads `.gitignore` from the project root (gracefully skips if missing).
2. Always excludes `.git/` regardless of `.gitignore` contents.
3. Walks the directory tree, pruning ignored directories early for speed.
4. Writes non-ignored files into a deflated ZIP archive.

---

## Development

```bash
pip install -e ".[dev]"
pytest
```

---

## License

[MIT](LICENSE)
