Skip to main content

Library used to compress txt files

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

Uploaded Source

Built Distribution

compressfiles-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: compressfiles-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 dd1af24557046cb7f9bb8eb64f02dcba6c1a2e07841ad441d4803d442cc6cbd5
MD5 089ab50f0acd38adc44b1988a54d3df2
BLAKE2b-256 f589b3a41b4b4ddeba6bacfe24129f5dda8b5c9d5a4540133fd7459a2b75c8f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for compressfiles-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5aea08176cad4bd9def2cb8e76563f55b45e744c48faa1b8e160f3c765e803ee
MD5 f5aeb37f011ed269f31d2e2fd4bd4f75
BLAKE2b-256 94376eae271029a40f46fda0f20d03cf99263058d9ce4acb8b45c38232e6fd66

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