Skip to main content

git-lfs-sempress

Automatic semantic compression for CSV files in Git repositories

PyPI License: MIT Python 3.10+

A Git LFS clean/smudge filter that compresses CSV files 8-12x using sempress vector quantization. Zero workflow changes -- just git add and git commit as usual.

Quick Start

# Install Git LFS first
git lfs install

# Install the plugin
pip install git-lfs-sempress

# Initialize in your repo
git lfs-sempress init

# Track CSV files
echo "*.csv filter=lfs-sempress diff=lfs merge=lfs -text" >> .gitattributes

# Use Git normally - compression happens automatically
git add data.csv
git commit -m "Add training data"

How It Works

  1. git add -- Sempress compresses CSV to .smp format (clean filter)
  2. Git LFS -- stores the compressed blob
  3. git checkout -- Sempress decompresses back to CSV (smudge filter)
  4. You see -- the original CSV file, seamlessly

Compression Results

$ git add training_data.csv
[sempress] Compressed: 4.0MB -> 471KB (8.5x ratio)

Typical ratios on real data:

  • IoT sensor data: 11.8x
  • Financial OHLC: 8.5x
  • ML feature vectors: 6-10x

Configuration

Create .sempress.yml in your repository root:

version: 1

compression:
  k: 64
  uncertainty_threshold: 0.2
  auto_lock: true
  lock_cols:
    - id
    - timestamp
  residual_cols:
    - amount
    - price

thresholds:
  min_size_mb: 1
  min_compression_ratio: 1.5

Commands

git lfs-sempress init              # Set up filter in current repo
git lfs-sempress track "*.csv"     # Add tracking pattern
git lfs-sempress analyze           # Estimate savings for existing files
git lfs-sempress stats             # Show compression stats for repo
git lfs-sempress quality a.csv b.csv  # Compare original vs reconstructed

Quality Assurance

  • String/ID columns: 100% exact match (automatically locked)
  • Numeric columns: < 0.1% relative error by default
  • Residual columns: bit-perfect reconstruction

If a column needs higher precision, add it to residual_cols in .sempress.yml.

Installation Notes

Windows: If git lfs-sempress isn't recognized, use:

python -m git_lfs_sempress.cli init

Links

License

MIT License - see LICENSE

Release files for git-lfs-sempress 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-lfs-sempress 0.1.1
File Size Uploaded
git_lfs_sempress-0.1.1.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-lfs-sempress 0.1.1
File Interpreter ABI Platform
git_lfs_sempress-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.9 kB

Release files / git_lfs_sempress-0.1.1.tar.gz

Download URL git_lfs_sempress-0.1.1.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19f5935529248ca66431768b4f40ea4b305b263ebe2929f78676ad36341f3e93
BLAKE2b-256 checksum
How to use checksums
4ccd41144d56dbc7d962e563d7c15d1678170e6ca28946ab3eaf697298b7a234
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / git_lfs_sempress-0.1.1-py3-none-any.whl

Download URL git_lfs_sempress-0.1.1-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31cc34e32f271f78ad1657d3e28165b08521b3d4175f5ecfd4bccdb638c0dc78
BLAKE2b-256 checksum
How to use checksums
bfcad38a6348206ac20ff6b54b423f7c70bb715a0c1d91aabcc0d9ec1d3ca62f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page