Installation
This guide walks you through installing climatextract.
Prerequisites
Before installing, ensure you have:
- Python 3.11+ – Download Python
- Azure credentials – Access to Azure AI Foundry, if using the default adapter (see step 3). Not required if you have models accessable via OpenRouter or if you're injecting your own provider handler — see Custom Providers.
Step 1: Install the Package
This installs climatextract with everything needed for the default input_mode = "text" (recommended).
Step 2: Install Additional Dependencies (Optional, Table Mode Only)
If you need to use input_mode = "text+table", also install the table dependencies:
Table mode renders PDF pages with pdf2image, which needs Poppler.
Download from poppler releases and add to PATH.
Step 3: Configure Access to Large Language Models
You will need to set up acess to a Large Language Model and to an embedding model. You can either use our adapters that we have built for Microsoft Azure, or write your own adapter. Since our adapters are based on liteLLM, building your own should be straightforward — see Custom Model Providers.
By default, the package will connect to Microsoft Azure's AI foundry.
Using Azure's AI foundry
We commonly use Azure's AI foundry. Create an .env file in your working directory with the correct endpoint and the respective API key.
AZURE_AI_FOUNDRY_ENDPOINT=https://your-foundry-endpoint.openai.azure.com/
API_KEY=your-api-key # you can also use personalized authentication workflows, see Step 4
In the configuration file you specify which models you want to use, e.g.:
llm_model = "gpt-5-chat"
emb_model = "text-embedding-ada-002"
max_parallel_llm_prompts_running = 20
max_parallel_embedding_calls = 30
Make sure that models with these names have been deployed in your AI foundry instance.
Rate limit errors may occur depending on the quota you have assigned to each deployed model. Use the max_parallel_...-parameters to limit the maximum number of API requests that will be sent in parallel, so that it matches with the model quota you have available.
The adapter for Azure's AI foundry is available at climatextract/adapters/azure_ai_foundry.py, useful for adaptions and debugging. A slightly different adapter / API endpoint may be needed if you wish to deploy models that are not from OpenAI.
Using Azure OpenAI
For older models and legacy deployments, the package also ships an Azure OpenAI Service adapter at climatextract/adapters/azure_openai.py. The .env file when using this service should be as follows:
AZURE_ENDPOINT=https://your-openai-endpoint.openai.azure.com/
API_KEY=your-api-key # you can also use personalized authentication workflows, see Step 4
API_VERSION=2024-12-01-preview
Using OpenRouter
openrouter.ai provides access to a wide variety of LLMs and embedding models. You will need an OpenRouter account with a small budget. Add its API_KEY to your .env file:
You will also need to import
and adapt the model configuration in the toml file. The OpenRouter setup is described in more detail in Custom Model Providers.
Step 4 (optional): Configure personalized authentication to Azure
Instead of using an API_KEY (problem: different endpoints require different API_KEYs), you can also log in to Azure with your personal account.
Install the azure_authentication package:
The simplest option is the Azure CLI: run az login once and remove API_KEY from your .env file. No further variables are needed. Your Azure account needs access to the deployed models (typically the role Cognitive Services OpenAI User).
Alternatively, add your credentials to your .env file:
To facilitate login processes, you can use the following. Be aware of the risk if you store secret information on your hard drive.
AZURE_SODA_WEBLOGIN=advanced
AZURE_SODA_CREDENTIAL_PATH=my_secret_azure_credential.json
AZURE_SODA_ALLOW_UNENCRYPTED_STORAGE=True
This functionality is based on the azure_authentication package. Please refer to its documentation for alternative authentication workflows.
Verify Installation
Test that everything is working:
Next Steps
Ready to extract some data? Head to the Quickstart guide.
You may also want to set up experiment tracking with MLflow or start sharing large (PDF) files with team members via Azure Blob Storage.