You can upload files to Tensorlake for parsing them without relying any external storage like S3.
Once uploaded, you’ll receive a unique file_id
that can be used with the /parse
endpoint to parse the file.
We also support pre-signed URLs or any publicly accessible URLs for files. You can skip the
upload step and directly use the /parse
endpoint with file URLs.
File Upload
Files uploaded are scoped to a specific project in your account. The API key provided with the API calls
is used to determine the project to which the file is uploaded. This is used to secure the files uploaded
and isolate them from other projects in your account.
from tensorlake.documentai import DocumentAI, ParsingOptions
doc_ai = DocumentAI(api_key="xxxx")
file_id = doc_ai.upload_file(file_path="/path/to/file.pdf")
print(file_id)
# tensorlake-r6NHbpBtbdTkTjJtfLHTF
from tensorlake.documentai import DocumentAI, ParsingOptions
doc_ai = DocumentAI(api_key="xxxx")
file_id = doc_ai.upload_file(file_path="/path/to/file.pdf")
print(file_id)
# tensorlake-r6NHbpBtbdTkTjJtfLHTF
curl -X POST https://api.tensorlake.ai/v1/files \
-H "Authorization: Bearer <API_KEY>" \
-F "file=@/path/to/file.pdf"
Delete File
from tensorlake.documentai import DocumentAI, ParsingOptions
doc_ai.delete_file(file_id="tensorlake-r6NHbpBtbdTkTjJtfLHTF")
from tensorlake.documentai import DocumentAI, ParsingOptions
doc_ai.delete_file(file_id="tensorlake-r6NHbpBtbdTkTjJtfLHTF")
curl -X DELETE https://api.tensorlake.ai/v1/files/tensorlake-r6NHbpBtbdTkTjJtfLHTF \
-H "Authorization: Bearer <API_KEY>"
List Files
from tensorlake.documentai import DocumentAI, FileInfo
doc_ai = DocumentAI(api_key="xxxx")
files_page = doc_ai.files()
from tensorlake.documentai import DocumentAI, FileInfo
doc_ai = DocumentAI(api_key="xxxx")
files_page = doc_ai.files()
curl -X GET https://api.tensorlake.ai/v1/files \
-H "Authorization: Bearer <API_KEY>"