Python client for the Unstract LLM-powered structured data extraction platform
Project description
unstract-python-client
Python client for the Unstract LLM-powered structured data extraction platform
Installation
You can install the Unstract Python Client using pip:
pip install unstract-client
Usage
First, import the APIDeploymentsClient
from the client
module:
from unstract.api_deployments.client import APIDeploymentsClient
Then, create an instance of the APIDeploymentsClient
:
client = APIDeploymentsClient(api_url="url", api_key="your_api_key")
Now, you can use the client to interact with the Unstract API deployments API:
try:
adc = APIDeploymentsClient(
api_url=os.getenv("UNSTRACT_API_URL"),
api_key=os.getenv("UNSTRACT_API_DEPLOYMENT_KEY"),
api_timeout=10,
logging_level="DEBUG",
)
# Replace files with pdfs
response = adc.structure_file(
["<files>"]
)
print(response)
if response["pending"]:
while True:
p_response = adc.check_execution_status(
response["status_check_api_endpoint"]
)
print(p_response)
if not p_response["pending"]:
break
print("Sleeping and checking again in 5 seconds..")
time.sleep(5)
except APIDeploymentsClientException as e:
print(e)
Questions and Feedback
On Slack, join great conversations around LLMs, their ecosystem and leveraging them to automate the previously unautomatable!
Unstract Cloud: Signup and Try!
Unstract developer documentation: Learn more about Unstract and its API.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for unstract_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bc80ae567e697dc58b775f05507ce654c3281c7f7b1ca5f3aec6a0a7cd610e9 |
|
MD5 | 9c9304bee2742611f3f3281761da9ca2 |
|
BLAKE2b-256 | bb9f74360e940fa1caa279f6e6c281fb25c03d33abe4cfa4dbd228025893e26f |