Skip to main content

ExtractFlow Parse

SimplifyX - Document Processing

License: MIT

🚀 Getting Started

Prerequisites

  • 🐍 Python >= 3.9
  • 🖥️ Ollama (if you want to use local models)
  • 🤖 API Key for OpenAI (OpenAI compatible models) or Google Gemini (if you want to use OpenAI or Google Gemini)

The easiest way to get started is by exploring the examples folder for additional sample use cases.

Azure LLama Vision

QWEN2-VL

OpenAI

Gemini

Ollama

Models Support

ExtractFlow supports various vision language models from different providers:

OpenAI Compatible Models

  • You can use any model that is compatible with OpenAI API.
  • By passing openai_compatible=True, and base_url to the parser, the parser will use the OpenAI API to process the image.

Ollama Models

  • llama3.2-vision:11b
  • llama3.2-vision:70b
  • llava:13b
  • llava:34b

OpenAI Models

  • gpt-4o
  • gpt-4o-mini

Gemini Models

  • gemini-1.5-flash
  • gemini-2.0-flash-exp
  • gemini-1.5-pro

Installation

Install the package using pip (Recommended):

pip install extractflow_parser

Install the optional dependencies for OpenAI or Gemini:

pip install 'extractflow_parser[openai]'
pip install 'extractflow_parser[gemini]'

Setting up Ollama (Optional)

See examples/ollama_setup.md on how to setup Ollama locally.

⌛️ Usage

Basic Example Usage

from extractflow_parser import ExtractFlowParser

# Initialize parser
parser = ExtractFlowParser(
    openai_compatible=True,
    base_url="https://api.fireworks.ai/inference/v1",
    api_key="your_api_key",
    model_name="accounts/fireworks/models/qwen2-vl-72b-instruct",
    temperature=0.2,
    top_p=0.3,
    extraction_complexity=True # Set to True for more detailed extraction
)

# Convert PDF to markdown
pdf_path = "path/to/your/document.pdf"
markdown_pages = parser.convert_pdf(pdf_path)

# Process results
for i, page_content in enumerate(markdown_pages):
    print(f"\n--- Page {i+1} ---\n{page_content}")

PDF Page Configuration

from extractflow_parser import ExtractFlowParser, PDFPageConfig

# Configure PDF processing settings
page_config = PDFPageConfig(
    dpi=400,
    color_space="RGB",
    include_annotations=True,
    preserve_transparency=False
)

# Initialize parser with custom page config
parser = ExtractFlowParser(
    model_name="llama3.2-vision:11b",
    temperature=0.7,
    top_p=0.4,
    extraction_complexity=False,
    page_config=page_config
)

# Convert PDF to markdown
pdf_path = "path/to/your/document.pdf"
markdown_pages = parser.convert_pdf(pdf_path)

OpenAI or Gemini Model Usage

from extractflow_parser import ExtractFlowParser

# Initialize parser with OpenAI model
parser = ExtractFlowParser(
    model_name="gpt-4o",
    api_key="your-openai-api-key", # Get the OpenAI API key from https://platform.openai.com/api-keys
    temperature=0.7,
    top_p=0.4,
    extraction_complexity=True # Set to True for more detailed extraction
)

# Initialize parser with Google Gemini model
parser = ExtractFlowParser(
    model_name="gemini-1.5-flash",
    api_key="your-gemini-api-key", # Get the Gemini API key from https://aistudio.google.com/app/apikey
    temperature=0.7,
    top_p=0.4,
    extraction_complexity=True # Set to True for more detailed extraction
)

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for extractflow-parser 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extractflow-parser 1.0.1
File Size Uploaded Provenance Actions
extractflow_parser-1.0.1.tar.gz 44.5 kB Without provenance Details for extractflow_parser-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for extractflow-parser 1.0.1
File Interpreter ABI Platform Actions
extractflow_parser-1.0.1-py3-none-any.whl Python 3 none any Details for extractflow_parser-1.0.1-py3-none-any.whl

Total release size: 54.7 kB

Release files / extractflow_parser-1.0.1.tar.gz

Download URL extractflow_parser-1.0.1.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6248ab1789c42103a66dbcb87adc0aa358a1a69928911619cfadb24c4c3df0c0
BLAKE2b-256 checksum
How to use checksums
b866571e4609abd87eb6955d3c9f7d7ece1723357b87c1d1fe2a3e68cd8c4393
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / extractflow_parser-1.0.1-py3-none-any.whl

Download URL extractflow_parser-1.0.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3657bf6210c55806c06a4c46f2d0a6718aeadc1038469c67555ff4506ee35ff5
BLAKE2b-256 checksum
How to use checksums
4dde9acdd9fa1d291aec59dcb012db15774926e00753db35a5ac7b2bb841020e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Security for extractflow-parser 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page