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.4.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

compressfiles-0.0.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for compressfiles-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0d10de1f0408ecfa104ba7ab8245344185a821655516e3ff869228306a1cd74e
MD5 f8bbf6b9044a068c8d36c04e6219be9e
BLAKE2b-256 1bb89ebaa90b73a8612c4e7e7f30450db71a78ecae2dbe470a7400ab39839fa9

See more details on using hashes here.

File details

Details for the file compressfiles-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for compressfiles-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 779db2f5ed38cb297b16485cc1e25537b37c90776990af0d8791cd2554bbb3a4
MD5 bc984d7a8a31eb38ff85d9bd4cf2d14d
BLAKE2b-256 69aeeb4edc2098a5da5f8347857b4dfeb3f1728cb4123ce5c3a83098f4db37ef

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