Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
A collection of Python scripts for file conversion tasks, built on top of the opencf-core framework.
The opencf
package provides a collection of Python scripts for file conversion tasks, built on top of the opencf-core framework. These scripts offer functionalities to convert various file formats, including text, CSV, JSON, XML, Excel, and image files, making it easy to handle different types of data transformations efficiently.
opencf-core
: Utilizes classes from the opencf-core
package for file I/O operations, MIME type detection, and exception handling.opencf-core
.opencf-core
.opencf-core
to build custom converters tailored to project requirements.This module provides classes for converting between different file formats. It includes concrete implementations of conversion classes for various file types.
TextToTextConverter
: Merges text-based files (txt, md, xml, json, ...) into a single text file.XMLToJSONConverter
: Converts XML files to JSON format. (Reader: XmlToTreeReader, Writer: DictToJsonWriter)CSVToXMLConverter
: Converts CSV files to XML format. (Reader: CsvToDictReader, Writer: TreeToXmlWriter)XLSXToCSVConverter
: Converts Excel files to CSV format. (Reader: XlsxToDictReader, Writer: DictToCsvWriter)CSVToXLSXConverter
: Converts CSV files to EXCEL format. (Reader: CsvToDictReader, Writer: DictToXlsxWriter)ImageToPDFConverterWithPyPdf
: Converts image files to PDF format using PyPDF. (Reader: ImageToPillowReader, Writer: PyPdfToPdfWriter)ImageToPDFConverterWithPillow
: Converts img files to pdf format using Pillow. (Reader: ImageToPillowReader, Writer: PillowToPDFWriter)PDFToImageConverterwithPymupdf
: Converts PDF files to image format using PyMuPDF. (Reader: PdfToPymupdfReader, Writer: PymupdfToImageWriter)PDFToImageExtractorwithPypdf
: Extracts images from PDF files using PyPDF. (Reader: PdfToPyPdfReader, Writer: PypdfToImageExtractorWriter)PDFToImageExtractorwithPymupdf
: Extracts images from PDF files using PyMuPDF. (Reader: PdfToPymupdfReader, Writer: PymupdfToImageExtractorWriter)PDFToDocxConvertorwithPdf2docx
: Converts PDF files to docx format using pdf2docx. (Reader: Pdf2DocxReader, Writer: Pdf2DocxWriter)PDFToDocxWithAspose
: Converts PDF files to docx format using Aspose.Words for Python. (Reader: AsposeReader, Writer: AsposeWriter)MergePDFswithPypdf
: Merges multiple PDF files into a single PDF. (Reader: PdfToPyPdfReader, Writer: PyPdfToPdfWriter)ImageToVideoConverterWithPillow
: Converts image files to video format using Pillow. (Reader: ImageToPillowReader, Writer: VideoArrayWriter)ImageToVideoConverterWithOpenCV
: Converts image files to video format using OpenCV. (Reader: ImageToOpenCVReader, Writer: VideoArrayWriter)VideoToGIFConverter
: Converts image files to GIF format using OpenCV and ImageIO. (Reader: VideoToFramesReaderWithOpenCV, Writer: FramesToGIFWriterWithImageIO)To use the opencf
package, follow these steps:
opencf-core
package is accessible.Here's an example demonstrating how to use the opencf
package for converting an PNG file to PDF:
# Install the package along with its dependencies (if not already installed)
pip install -i https://test.pypi.org/simple/ opencf
# Run the converter script
opencf examples/input/example.png -o examples/output/example.pdf
# or
opencf examples/input/example.png -ot pdf
This command executes the ConverterApp
class, initiating the conversion process from an PNG file to a PDF file using the appropriate converter classes.
You can set, the output argument as a folder. So, the png files would be in that folder. Using a filepath instead of a folder may yield an error.
opencf examples/input/example.pdf -o examples/output -ot png
This command will write png files into the examples/output
as mentioned
Contributions to the opencf
package are welcome! Feel free to submit bug reports, feature requests, or pull requests via the GitHub repository. Additionally, consider extending the functionality by adding support for additional file formats or improving existing converter classes.
FAQs
A collection of Python scripts for file conversion tasks, built on top of the opencf-core framework.
We found that opencf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.