Skip to main content

Simple way to convert files to another formats

Project description

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:
    yay -S libreoffice
    
    • Ubuntu, RedHat:
    sudo apt install libreoffice
    
  2. Install multi-file-converter:
    pip install multi-file-converter
    

Usage

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()

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

multi_file_converter-1.0.9.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

multi_file_converter-1.0.9-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file multi_file_converter-1.0.9.tar.gz.

File metadata

  • Download URL: multi_file_converter-1.0.9.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for multi_file_converter-1.0.9.tar.gz
Algorithm Hash digest
SHA256 f829171054fc1677ebb2bf828fcffc697f104deae9bc278fe26651fec88a4bad
MD5 09029357792df1d9251f66c557314542
BLAKE2b-256 cba0e76cfeae5de45cefa2affc112169b403df2143037b978ebb400df2687e0e

See more details on using hashes here.

Provenance

File details

Details for the file multi_file_converter-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for multi_file_converter-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f99b0950f15ab235f937b5639cf4fc79f4b585eea2426c176a4b3d0b4acb4d64
MD5 3d6c0865fa8be0b7f4a0ca88e9427a55
BLAKE2b-256 a04a36a4c02bd27c6ca39fc5f560090127e2a3725d41abe47f47035ce6cfdbcb

See more details on using hashes here.

Provenance

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