GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — examples/python-pdf-form-extractor at main · triggerdotdev/examples

Expand file tree

/

python-pdf-form-extractor

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

python-pdf-form-extractor

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
requirements.txt
requirements.txt
 
 
trigger.config.ts
trigger.config.ts
 
 
tsconfig.json
tsconfig.json
 
 

README.md

Outline

Trigger.dev + Python PDF form extractor demo

This demo showcases how to use Trigger.dev with Python to extract structured form data from a PDF file available at a URL.

Features

  • A Trigger.dev task to trigger the Python script
  • Trigger.dev Python build extension to install the dependencies and run the Python script
  • PyMuPDF to extract form data from PDF files
  • Requests to download PDF files from URLs

Getting Started

  1. After cloning the repo, run npm install to install the dependencies.
  2. Create a virtual environment python -m venv venv
  3. Activate the virtual environment, depending on your OS: On Mac/Linux: source venv/bin/activate, on Windows: venv\Scripts\activate
  4. Install the Python dependencies pip install -r requirements.txt
  5. Copy the project ref from your Trigger.dev dashboard and add it to the trigger.config.ts file.
  6. Run the Trigger.dev CLI dev command (it may ask you to authorize the CLI if you haven't already).
  7. Test the task in the dashboard by providing a valid PDF URL.
  8. Deploy the task to production using the Trigger.dev CLI deploy command.

Relevant code

  • pythonPdfTask.ts triggers the Python script and returns the structured form data as JSON
  • trigger.config.ts uses the Trigger.dev Python extension to install the dependencies and run the script
  • extract-pdf-form.py is the main Python script that takes a URL and returns the form data from the PDF in JSON format
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.