An Azure Function to automatically generate PDFs from KoboToolbox submissions and store them in Azure Blob Storage. This project is aimed at humanitarian organizations using KoboToolbox to simplify the process of generating and managing submission PDFs.
The KoboToolbox PDF Generator function app is designed to streamline the process of converting KoboToolbox submissions into PDFs when a new submission is recorded trough REST API and storing them securely in Azure Blob Storage. The function supports different KoboToolbox servers and can be easily configured for various environments and credentials.
- Python 3.10
- Azure Functions Core Tools
- Azure Storage Account
-
Clone the Repository:
git clone https://github.com/your-github-username/kobo-pdf-generator.git cd kobo-pdf-generator
-
Install Requirements:
pip install -r requirements.txt
-
Configure Azure Function:
Set environment variables for AzureWebJobsStorage. Deploy the function to Azure.
-
Login to Azure:
az login
-
Deploy the Function:
func azure function publish <YourFunctionAppName>
POST /api/http_trigger
{
"kobo_server": "your_kobo_server",
"username": "your_username",
"password": "your_password",
"kobo_api_token": "your_kobo_api_token",
"asset_id": "your_asset_id",
"submission_id": "your_submission_id"
}
{
"pdf_url": "https://your-storage-account.blob.core.windows.net/pdfs/submission_id.pdf"
}
If you wish to use the API for testing, access can be provided through an access token to call the POST function. Please request access via this form. We will get back to you quickly.
This project is licensed under the MIT License.
Created by 13w.