Skip to content

An Azure Function to automatically generate PDFs from KoboToolbox submissions

Notifications You must be signed in to change notification settings

13w13/kobo-pdf-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KoboToolbox PDF Generator

License: MIT

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.

Overview

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.

Setting Up Your Own Azure Function and Blob Storage

Prerequisites

  • Python 3.10
  • Azure Functions Core Tools
  • Azure Storage Account

Installation

  1. Clone the Repository:

    git clone https://github.com/your-github-username/kobo-pdf-generator.git
    cd kobo-pdf-generator
  2. Install Requirements:

    pip install -r requirements.txt
  3. Configure Azure Function:

    Set environment variables for AzureWebJobsStorage. Deploy the function to Azure.

Deployment

  1. Login to Azure:

    az login
  2. Deploy the Function:

    func azure function publish <YourFunctionAppName>

Using the API Endpoint

    POST /api/http_trigger

Request Body

{
  "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"
}

Response

{
  "pdf_url": "https://your-storage-account.blob.core.windows.net/pdfs/submission_id.pdf"
}

Request Access Token

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.

License

This project is licensed under the MIT License.

Creator

Created by 13w.

About

An Azure Function to automatically generate PDFs from KoboToolbox submissions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages