Python PDF Extractor for Structured Testing Data
Budget: $250 – $750 USD
Develop a Python script that performs the following:
Downloads a technical PDF file from this public URL:
https://gobdiyhmhkanblppvlrq.supabase.co/storage/v1/object/public/fotos//INTER%20ST001925-ARM.pdf
Processes the PDF to extract structured test data.
Use either OpenAI API or Mistral API (whichever is more efficient or cost-effective for document QA).
You may use OCR (if needed) and LLM-based extraction.
Extract the following fields for each test requirement block:
"requirement_column_2": The requirement or test as written in the document (English translation if necessary).
"result_column_3": The result or measurement for that test.
If the result is a table, output the HTML representation of the table as shown in the example.
If the result is only text, return the raw text.
"evaluation": The evaluation/assessment value (typically 'C', 'NA', or similar).
Output:
Return a single JSON array, where each element contains the three fields above, matching this structure:
json
Copy
Edit
[
{
"requirement_column_2": "The equipment input current under normal load conditions should not exceed the nominal current by more than 10%. Readings are taken when the input current has stabilized",
"result_column_3": "<table border=\"1\">\n <tr>\n <th>I nominal (A)</th>\n <th>Test Voltage (V)</th>\n <th>I measure (A)</th>\n </tr>\n <tr>\n <td>1.0</td>\n <td>100V/50Hz</td>\n <td>0.361</td>\n </tr>\n <tr>\n <td>1.0</td>\n <td>100V/60Hz</td>\n <td>0.361</td>\n </tr>\n <tr>\n <td>1.0</td>\n <td>240V/50Hz</td>\n <td>0.182</td>\n </tr>\n <tr>\n <td>1.0</td>\n <td>240V/60Hz</td>\n <td>0.180</td>\n </tr>\n</table>Deviation: -82% to -63.9%",
"evaluation": "C"
},
{
"requirement_column_2": "The nominal voltage of a portable equipment must not exceed 250 V.",
"result_column_3": "No a portable equipment",
"evaluation": "NA"
}
// ... more entries
]
Technical Requirements
The script must be fully automated, requiring only the PDF URL as input.
The output must be a single JSON file (output.json) with all the extracted blocks.
You may use libraries such as pdfplumber, PyMuPDF, or other OCR tools for extraction if necessary.
All API keys (OpenAI/Mistral) should be accepted via environment variables or .env file and never hardcoded.
Deliverables
Python script (extract_pdf_data.py or similar).
Instructions for installing dependencies and running the script.
Example output file (output.json).
Note:
Extraction should be as close to the document's original table/text as possible.
All fields must match the original formatting (e.g., tables in HTML).
If any field is missing in the document, set the corresponding value to an empty string or "NA".
Downloads a technical PDF file from this public URL:
https://gobdiyhmhkanblppvlrq.supabase.co/storage/v1/object/public/fotos//INTER%20ST001925-ARM.pdf
Processes the PDF to extract structured test data.
Use either OpenAI API or Mistral API (whichever is more efficient or cost-effective for document QA).
You may use OCR (if needed) and LLM-based extraction.
Extract the following fields for each test requirement block:
"requirement_column_2": The requirement or test as written in the document (English translation if necessary).
"result_column_3": The result or measurement for that test.
If the result is a table, output the HTML representation of the table as shown in the example.
If the result is only text, return the raw text.
"evaluation": The evaluation/assessment value (typically 'C', 'NA', or similar).
Output:
Return a single JSON array, where each element contains the three fields above, matching this structure:
json
Copy
Edit
[
{
"requirement_column_2": "The equipment input current under normal load conditions should not exceed the nominal current by more than 10%. Readings are taken when the input current has stabilized",
"result_column_3": "<table border=\"1\">\n <tr>\n <th>I nominal (A)</th>\n <th>Test Voltage (V)</th>\n <th>I measure (A)</th>\n </tr>\n <tr>\n <td>1.0</td>\n <td>100V/50Hz</td>\n <td>0.361</td>\n </tr>\n <tr>\n <td>1.0</td>\n <td>100V/60Hz</td>\n <td>0.361</td>\n </tr>\n <tr>\n <td>1.0</td>\n <td>240V/50Hz</td>\n <td>0.182</td>\n </tr>\n <tr>\n <td>1.0</td>\n <td>240V/60Hz</td>\n <td>0.180</td>\n </tr>\n</table>Deviation: -82% to -63.9%",
"evaluation": "C"
},
{
"requirement_column_2": "The nominal voltage of a portable equipment must not exceed 250 V.",
"result_column_3": "No a portable equipment",
"evaluation": "NA"
}
// ... more entries
]
Technical Requirements
The script must be fully automated, requiring only the PDF URL as input.
The output must be a single JSON file (output.json) with all the extracted blocks.
You may use libraries such as pdfplumber, PyMuPDF, or other OCR tools for extraction if necessary.
All API keys (OpenAI/Mistral) should be accepted via environment variables or .env file and never hardcoded.
Deliverables
Python script (extract_pdf_data.py or similar).
Instructions for installing dependencies and running the script.
Example output file (output.json).
Note:
Extraction should be as close to the document's original table/text as possible.
All fields must match the original formatting (e.g., tables in HTML).
If any field is missing in the document, set the corresponding value to an empty string or "NA".
Related categories:
JavaScript
Python
Web Scraping
Software Architecture
OCR
Data Extraction
API Integration
OpenAI