The UnDatasIO Client for Python enables easy interaction with the UnDatasIO API, allowing developers to execute queries and mutations against the UnDatasIO platform.
Prerequisites
Before you begin, ensure you have the following:
Python 3.8 or later is installed on your system.
An active account on the UnDatasIO Platform with access to the API Settings page.
Get your TOKEN
Installation
To install the UnDatasIO Client, use pip
pip install UnDatasIO
Configuration
Please obtain your token in the User Center. If task_name is not filled in, PdfParserDemo will be used as the default task_name.
from undatasio.undatasio import UnDatasIO
token = 'Your API token'
task_name = 'your task name'
# 1. Initialize the UnDatasIO client
client = UnDatasIO(token=token, task_name=task_name)
# 6. View parsing results (assuming you know the version number is 'v1' and want to get the title and table information in the parsing results)
results = client.get_result_type(type_info=['title', 'table'], file_name='example_file.pdf', version='v1')
if results['code'] == 200:
print(f"Parsing results: {results.json()}")
else:
print(f"Failed to get parsing results: {results['msg']}")