FastAPI server providing a Wrapper for Microsoft MarkItDown and Unstructured.io
A simple service/library that converts many file types (PDF, DOCX, PPTX, images, HTML, etc.) into clean Markdown for downstream use.
/markitdown/extracts
A Python-first toolkit and hosted services for document parsing & chunking. Converts diverse formats (PDF, DOCX, PPTX, EML, HTML, images, etc.) into structured “elements” (Title, NarrativeText, Table, FigureCaption, etc.), with optional OCR and layout models.
unstructured/extracts
- Clone the repository
- Install dependencies:
pip install -r requirements.txtCreate a .env file with the required variables for your chosen AI provider:
API_KEY=your_api_key_here
AZURE_OPENAI_API_KEY=your_azure_openai_key_here
AZURE_OPENAI_ENDPOINT=https://your-azure-openai-resource.openai.azure.com
AZURE_OPENAI_API_VERSION=2024-02-15-preview
AZURE_OPENAI_DEPLOYMENT=gpt-4o-deployment-name
API_KEY=your_api_key_here
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
AWS_REGION=us-east-1
AWS_BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20240620-v1:0
Note: When using AWS Bedrock, ensure that:
- Your AWS credentials have permissions to access Amazon Bedrock
- You have requested access to Claude 3.5 Sonnet model in your AWS region
- The Claude 3.5 Sonnet model is available in your chosen AWS region
AWS_BEDROCK_MODEL_IDis optional and defaults toanthropic.claude-3-5-sonnet-20240620-v1:0
Start the server with:
python3 -m extraction.main- Copy
.env.exampleto.envand fill in your API keys. - Run:
docker compose upAPI_KEY: The key required for endpoint authentication.AZURE_OPENAI_API_KEY: Your Azure OpenAI API key.AZURE_OPENAI_ENDPOINT: Your Azure OpenAI endpoint URL.AZURE_OPENAI_API_VERSION: Azure OpenAI API version.AZURE_OPENAI_DEPLOYMENT: Azure OpenAI deployment name for the model to use.PORT: The port the API will run on (default 8080).