This is the main page for my Open Source project cmemgzip.

Current Version is 0.4.4 from 2021-06-27.

PIP Download page.

cmemgzip working with several files and skipping compressed files.
cmemgzip v.0.4.2 running in the sample Docker Container provided.
Here compressing an .ISO file from Ubuntu 18.04. Obviously we save few space as ISO files are already compressed.

cmemgzip compress files in memory, deletes the original, and writes the compressed file, saving the day in situations where your Server ran out of space and you want to keep those heavy logs.

If creates .gz files that later you can uncompress with:

  • gunzip
  • zcat
  • The compressed file explorer from Ubuntu

Url of the project in PyPi:

cmemgzip allows to define a block size for the chunks read from disk, limiting the amount of memory needed.

cmemgzip running in Windows 10 Home 64 bit and using 100MB blocks

Here you can see a fast worfard compression of a 5.82GB log file in an Amazon Server which ran out of space (0 bytes free) and has 2.8GB of RAM available, using blocks of memory of 500MB.

Get the source code

You can decompress it later with gzip/gunzip.

So about cmemgzip you can git clone the project from here:

git clone



Install from PIP

Use pip for Python 3 to install the cmemgzip package:

pip3 install cmemgzip

Install cloning from git

Just clone it from the gitlab repository:

git clone

There are no third party libraries to install. I only use the standard ones: os, sys, gzip, datetime, time

So clone it with git in your preferred folder and just create a symbolic link with your favorite name:

sudo ln –symbolic /home/carles/code/cmemgzip/ /usr/bin/cmemgzip

I like to create the link without the .py extension.

This way you can invoke the program from anywhere by just typing:


For Windows users, colors are disabled.

See also:

Views: 2,285 views

Rules for writing a Comment

  1. Comments are moderated
  2. I don't publish Spam
  3. Comments with a fake email are not published
  4. Disrespectful comments are not published, even if they have a valid point
  5. Please try to read all the article before asking, as in many cases questions are already responded