JsonLLM client
jsonllm-client is a Python client library for interacting with the JsonLLM API.
JsonLLM allows you to extract structured data from documents.
jsonllm-client allows users to upload documents and delete documents, as well as extract data from said
documents.
Installation
jsonllm-client is available on PyPI, so it can be installed easily, e.g. using pip:
pip install jsonllm_client
Initialization
You need to create an API key, which you can do here.
from jsonllm_client import JsonLLM
api_key = "your_api_key_here"
json_llm = JsonLLM(api_key)
Upload document(s)
To upload a document to a project, you need to use the .upload method:
from jsonllm_client import JsonLLM
api_key = "your_api_key_here"
jsonllm = JsonLLM(api_key)
jsonllm.upload("invoice", "/home/ubuntu/Invoice_105274235.pdf")
To upload multiple documents, simply supply multiple paths:
from jsonllm_client import JsonLLM
api_key = "your_api_key_here"
jsonllm = JsonLLM(api_key)
jsonllm.upload("invoice", ["/home/ubuntu/Invoice_13.pdf", "/home/ubuntu/Invoice_91.pdf"])
Add plain text document(s)
To add a document from plain text, use the .add_text method:
from jsonllm_client import JsonLLM
api_key = "your_api_key_here"
jsonllm = JsonLLM(api_key)
jsonllm.add_text("news", "cnn_article.txt", "Tensions rise.")
Extract from document
import json
from jsonllm_client import JsonLLM
api_key = "your_api_key_here"
jsonllm = JsonLLM(api_key)
res = jsonllm.extract(
project="invoice",
filename="Invoice_105274235.pdf"
)
print(json.dumps(res, indent=2))
# {
# "invoice_date": "July 4, 2017",
# "invoice_id": "105274235",
# "s3_amount": "0.11",
# "tax_amount": "0.00",
# "total_amount": "52.57",
# "vendor_name": "Amazon Web Services, Inc"
# }
Delete document(s)
To delete a document, use the .delete_document method
from jsonllm_client import JsonLLM
api_key = "your_api_key_here"
jsonllm = JsonLLM(api_key)
jsonllm.delete_document("invoice", "/home/ubuntu/Invoice_105274235.pdf")
Metadata
Release files for jsonllm-client 0.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| jsonllm_client-0.16.0.tar.gz | 7.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jsonllm_client-0.16.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.5 kB
Release files / jsonllm_client-0.16.0.tar.gz
| Download URL | jsonllm_client-0.16.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66e906810a28bf510270794cdf5b23022e0949348f61a3a69244286e25197cf7
|
|
BLAKE2b-256 checksum How to use checksums |
1d9bfcf08a748df945ec176a77f95ea2b81dc40f776233c1c165d6a51735df17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Release files / jsonllm_client-0.16.0-py3-none-any.whl
| Download URL | jsonllm_client-0.16.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b97c2d9465f1b9da6b15f538d21e6ee25791ef3b61b26484c93a85583efb708
|
|
BLAKE2b-256 checksum How to use checksums |
58685ce55954d8070371465e39c4bb92ab960ac201ab01642299091dc61290c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Security for jsonllm-client 0.16.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.