A collection of Python packages for the month project, providing utilities for file operations, configuration management, email handling, and OCR processing.
The pyfunc2 package is organized into several subpackages:
- pyfunc2-file: File operations utilities
- pyfunc2-config: Configuration management utilities
- pyfunc2-email: Email handling utilities
- pyfunc2-ocr: OCR processing utilities for PDF documents
You can install the packages individually or the main package which includes all subpackages:
# Install main package
pip install pyfunc2
# Or install individual packages
pip install pyfunc2-file
pip install pyfunc2-config
pip install pyfunc2-email
pip install pyfunc2-ocrfrompyfunc2.fileimportcreate_folder, check_and_create_path# Create a directorycreate_folder("path/to/directory")
# Check and create a path if it doesn't existcheck_and_create_path("path/to/directory")frompyfunc2.configimportget_config, get_email_path# Get configuration valuesconfig=get_config(folder="/.cfo/", key="emails")
# Get email pathemail_path=get_email_path("target", "storage_root")frompyfunc2.emailimportconnect, download_emails, download_all_attachments_in_inbox# Connect to an email servermail=connect("imap.example.com", "username", "password")
# Download emailsdownload_emails("imap.example.com", "username", "password", "local_path", "INBOX", limit=50, month=5, year=2023)
# Download attachmentsdownload_all_attachments_in_inbox("imap.example.com", "username", "password", "local_path", "INBOX")frompyfunc2.ocrimportget_company_from_pdf, get_date_from_pdf, get_date_from_pdf_pattern, CompanyList# Get company listcompany_list=CompanyList().sorted_from_shortest_to_longest_name()
# Extract company from PDFcompanies=get_company_from_pdf("path/to/file.pdf", [], company_list)
# Extract date from PDFdates=get_date_from_pdf(
"path/to/file.pdf",
get_date_from_pdf_pattern.format_out_list,
["remove_extra_spaces"],
get_date_from_pdf_pattern.pattern_input_list,
['en_US', 'de_DE']
)This project uses Poetry for dependency management. To set up the development environment:
# Install Poetry
pip install poetry
# Install dependenciescd pyfunc2
poetry install
# Build the package
poetry buildThis project is licensed under the MIT License - see the LICENSE file for details.