Skip to main content

A Python utility for zipping directories and files

Project description

Automate dir zipping⚡️

CLI for flexibly zipping and extracting items.

Features

  • compress files and dirs as required
    • run command for zipping dirs/files of choice
    • run command for defining where compressed files should live

Prerequisites

  • Python 3.12+
  • Git
  • uv (recommended) or pip

Quick Start

# Compress current directory
$ uv run zippa pack .

# Compress specific files
$ uv run zippa pack file1.txt dir1/ file2.py

# Extract zip file
$ uv run zippa extract backup.zip

# Extract to specific directory
$ uv run zippa extract backup.zip --output /path/to/extract/

Common Patterns

Working with Different Directories

# Compress from external directory
$ uv run zippa pack . --work-dir ~/path/to/project --output backup.zip

# Compress specific files from external directory
$ uv run zippa pack file1.txt dir1/ --work-dir ~/path/to/project

Excluding Files

# Exclude patterns via command line
$ uv run zippa pack . --exclude "*.pyc" --exclude "__pycache__"

# Use .zipignore file (create in project root)
$ uv run zippa pack . --exclude-file .zipignore

Overwrite Protection

# Default: Skip if files exist (safe)
$ uv run zippa pack . --output backup.zip

# Ask before overwriting (interactive)
$ uv run zippa pack . --output backup.zip --ask

# Force overwrite (non-interactive)
$ uv run zippa pack . --output backup.zip --force-overwrite

.zipignore File

Create a .zipignore file in your project root:

# .zipignore example
*.pyc
__pycache__/
*.log
*.tmp
.git/
node_modules/
.env
*.DS_Store
build/
dist/
*.egg-info/

Notes

  • Items are relative to your current working directory (or --work-dir if specified)
  • Output location can be anywhere (absolute or relative path)
  • Use --help for complete command reference

Future Updates

  • make syntax for running commands more intuitive
  • implement compression summary after each compression
  • listen to events and compress correspondently

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

zippa-0.1.5.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

zippa-0.1.5-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file zippa-0.1.5.tar.gz.

File metadata

  • Download URL: zippa-0.1.5.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for zippa-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b0956b27ebea172fd47cb18f4c07c27ba30d69b1b026c42b672ed594ff0a142a
MD5 e7948b87ddd66399525fc2be33cbd398
BLAKE2b-256 9303b3c53db64717c74aaa69fb4d43bfdfd64060c5cd5915346cfbffc639f23f

See more details on using hashes here.

File details

Details for the file zippa-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: zippa-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for zippa-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 58412b260703745225bc1a059ec2799ce5fcd997b2136c44140d349ab520ca11
MD5 ae330a2e87a8c99e66b49bd40f68efb6
BLAKE2b-256 3760820d27d4f564616d6ac00dabf73209bbec74e222ea96a2b3f625d4c30a18

See more details on using hashes here.

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