
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
This module, part of the `abstract_essentials` package, provides a collection of utility functions for working with images and PDFs, including loading and saving images, extracting text from images, capturing screenshots, processing PDFs, and more.
abstract_images
Module - Image and PDF Utilitiesabstract_essentials
PackageGitHub Repository: abstract_essentials
Contact Email: partners@abstractendeavors.com
Date: 08/27/2023
Version: 0.0.0.1
This module, part of the abstract_essentials
package, provides a collection of utility functions for working with images and PDFs, including loading and saving images, extracting text from images, capturing screenshots, processing PDFs, and more.
image_utils.py
The image_utils.py
module contains functions for image-related operations.
pdf_utils.py
The pdf_utils.py
module provides functions for PDF processing.
if_none_return(obj, obj_2)
: Return primary object if secondary object is None
.write_pdf()
: Initialize and return a new PDF writer object.read_pdf(file)
: Read a PDF from a given path and return a PDF reader object.is_pdf_path(file)
: Check if a file path corresponds to a valid PDF file.get_pdf_obj(pdf_obj)
: Process a PDF object or file path and return its content.split_pdf(input_path, output_folder, file_name)
: Split a PDF file into separate pages.pdf_to_img_list(pdf_list, output_folder, file_name, paginate, extension)
: Convert PDF files into images.img_to_txt_list(img_list, output_folder, file_name, paginate, extension)
: Convert images to text using OCR.open_pdf_file(pdf_file_path)
: Open a PDF file using the default system application.image_to_text(image_path)
: Convert an image to text using Tesseract OCR.get_pdfs_in_directory(directory)
: Get a list of PDF filenames in a directory.get_all_pdf_in_directory(file_directory)
: Get full paths of all PDFs in a directory.collate_pdfs(pdf_list, output_pdf_path)
: Merge a list of PDFs into one.To showcase the pdf_utils
module, here's an example combining several utility functions:
from abstract_images.pdf_utils import (
get_file_name, get_directory, mkdirs, split_pdf,
pdf_to_img_list, img_to_txt_list
)
pdf_path = "path_to_pdf"
file_name = get_file_name(pdf_path)
directory = get_directory(pdf_path)
pdf_folder = mkdirs(os.path.join(directory, file_name))
pdf_split_folder = mkdirs(os.path.join(pdf_folder, "split"))
pdf_list = split_pdf(input_path=pdf_path, output_folder=pdf_split_folder, file_name=file_name)
pdf_Image_folder = mkdirs(os.path.join(pdf_folder, "images"))
img_list = pdf_to_img_list(pdf_list=pdf_list, output_folder=pdf_Image_folder, paginate=False, extension="png")
pdf_Text_folder = mkdirs(os.path.join(pdf_folder, "text"))
text_list = img_to_txt_list(img_list=img_list, output_folder=pdf_Text_folder, paginate=False, extension="txt")
For queries, bug reports, or feature requests, please raise an issue on the GitHub repository or contact us through the provided email: partners@abstractendeavors.com. Ensure that you have the required dependencies installed, and for OCR operations, ensure Tesseract is properly set up and its path is correctly specified.
FAQs
This module, part of the `abstract_essentials` package, provides a collection of utility functions for working with images and PDFs, including loading and saving images, extracting text from images, capturing screenshots, processing PDFs, and more.
We found that abstract-images 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.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.