The File Compression and Decompression App is a simple Python application that allows users to compress and decompress files using the zlib compression algorithm. This app provides an interactive command-line interface for compressing and decompressing files with various compression levels.
- Compression: Compress files with varying levels of compression (0 to 9).
- Decompression: Decompress previously compressed files.
- Interactive Interface: The app provides a user-friendly command-line interface for file compression and decompression.
- Error Handling: It includes error handling to ensure that file paths and compression levels are provided correctly.
- Open Source: This app is open-source and can be customized as needed.
To use the File Compression and Decompression App, follow these steps:
- Clone or download the app to your local machine.
- Open a terminal or command prompt.
- Navigate to the directory where the
app.py
script is located. - Run the app using the command
python3 app.py
.
The app will ask you whether you want to compress (C) or decompress (D) a file. Depending on your choice, it will prompt you for the relevant file paths and compression level.
To get started with the File Compression and Decompression App, follow these instructions:
-
Clone the Repository: If you haven't already, clone the app repository to your local machine using Git:
git clone https://github.com/Freddy155/file-compression.git
-
Navigate to the Directory: Open your terminal or command prompt and navigate to the directory where the app.py script is located.
cd file-compressor
-
Install Dependencies: The app uses the built-in zlib library for compression and decompression, so there are no additional dependencies to install.
pip install zlib
-
Run the App: Run the app using the following command:
python app.py
-
Follow the on-screen instructions to compress or decompress files.
To compress a file, choose the C
option and provide the following information:
- Input file path: Enter the path to the file you want to compress.
- Compressed file path: Enter the path where the compressed file will be saved.
- Compression level: Choose a compression level from 0 (no compression) to 9 (maximum compression).
To decompress a file, choose the D
option and provide the following information:
- Compressed file path: Enter the path to the compressed file you want to decompress.
- Decompressed file path: Enter the path where the decompressed file will be saved.