Skip to main content

Library used to compress files using gzip but more simple

Project description

GZip Compression Utility

This is a Python package that provides a simple utility for compressing and decompressing files using the GZip format. The package uses the gzip module from the Python standard library.

Installation

You can install the package using pip:

pip install compressfiles

Usage

The package provides two main functions: compress() and decompress().

Compressing a txt file

To compress a file, use the compress() function. For example:

from compressfiles import compress

compress('my_file.txt')

This will compress my_file.txt and save the compressed file as my_file.gz.

You can also specify the output file path using the output_file_path parameter:

compress('my_file.txt','my_file.gz') You can customize the compression level (0-9), default is '6' compress('my_file.txt','my_file.gz', '8')

Decompressing a file

To decompress a file, use the decompress() function. For example:

from compressfiles import decompress

decompress('my_file.gz')

This will decompress my_file.gz and save the decompressed file as my_file.txt.

You can also specify the output file path using the output_file_path parameter:

decompress('my_file.gz', 'my_file.txt')

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

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

compressfiles-0.0.5.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file compressfiles-0.0.5.tar.gz.

File metadata

  • Download URL: compressfiles-0.0.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for compressfiles-0.0.5.tar.gz
Algorithm Hash digest
SHA256 446257d5ab70828695da302fa78a84f364df6ebddcdcb44cf761ba54f7b943bd
MD5 b3ef52482cf799fb0d35efeee748ad04
BLAKE2b-256 a8b7d95789978baed55cb017ecf1dd258cad1eef9a4450b2c460022ef8189d9e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page