Metadata-Version: 2.1
Name: multi_file_converter
Version: 1.0.9
Summary: Simple way to convert files to another formats
Home-page: https://github.com/DAKExDUCK/FileConverter
Author: dake_duck
Author-email: arsengabdulin228@gmail.com
Project-URL: GitHub, https://github.com/DAKExDUCK/FileConverter
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# ConvertFilesClass

The main idea is to simplify converting files to another formats

**ONLY LINUX!!!**


For now support:

| From | To |
| --- | ------------- |
| JPG | PNG, BMP, TIFF |
| PNG | JPG, BMP, TIFF |
| DOCX | PDF, ODT, HTML, TXT, RTF |
| PDF | HTML |

> Converting to `HTML` is sometimes looks weird because of `libreoffice` package


#### Preparation
1. Install `libreoffice` Linux package:
    - Arch:
    ```bash
    yay -S libreoffice
    ```
    - Ubuntu, RedHat:
    ```bash
    sudo apt install libreoffice
    ```
2. Install `multi-file-converter`:
    ```bash
    pip install multi-file-converter
    ```

#### Usage

```python
from file_converter import JPG, PNG

jpg = JPG('media/input.jpg') # or io.BytesIO object
png_bytes = jpg.convert_to_png() # convert and return new io.BytesIO object
with open('media/output.png', 'wb') as outfile:
    outfile.write(png_bytes.getbuffer()) # write to file

# show converted image
png = PNG(png_bytes)
png.img.show()
```
