Anno Lab API (V1)
  • Setup
    • AnnoLab SDK
  • Projects, Directories, and Sources
    • Projects
    • Directories
    • Source Files
  • Schemas / Ontologies
    • Annotation Types
    • Model Inferences
  • Annotations and Relations
    • Annotations
    • Canonical Tags
    • Instruments
    • Relations
    • Annotation Layers
  • Exports
    • Export Instruments
    • Export Project
  • Search
    • Search Instruments
  • Abstracts
    • Abstracts
Powered by GitBook
On this page
  • Installing via pip
  • Using the sdk
  • Using the sdk to upload pdf source
  • Using the sdk to upload pdf source and trigger an AI workflow

Was this helpful?

  1. Setup

AnnoLab SDK

Python SDK to interact with AnnoLab

PreviousSetupNextProjects

Last updated 2 years ago

Was this helpful?

AnnoLab has a python SDK to improve the experience of performing certain AnnoLab actions. We highly recommend using this SDK for things like uploading files, as it greatly speeds uploads and simplifies the experience.

Installing via pip

pip install annolab

Using the sdk

To get started, ensure you have an annolab account at and have created an API Key. Instructions for creating an API Key may be found at .

  1. Create an instance of the SDK passing your api_key.

from annolab import Annolab
lab = AnnoLab(api_key='YOUR_API_KEY')

Using the sdk to upload pdf source

For pdf uploads to work, the user associated with your api key must have permissions to edit sources on your project. Permissions can be modified by admins on the appropriate project details page found under

Obtain the project

project = lab.find_project('My Project')

Upload from a local file system to a specific directory in your project. OCR the pdf using annolab OCR

project.create_pdf_source(
    file='/path/to/file', 
    name='custom_name.pdf', 
    directory='Uploads',
    ocr=True,
    ocrProvider='textract_plus', # textract_plus is the same as "Annolab" OCR
)

Using the sdk to upload pdf source and trigger an AI workflow

For pdf uploads invoking workflows to work, the user associated with your api key must have permissions to edit sources on your project and must have the ability to "run" machine learning models on your project.

Obtain the project

project = lab.find_project('My Project')

Upload from a local file system to a specific directory in your project. Use the OCR provider and suite of ML models specified by a workflow

project.create_pdf_source(
    file='/path/to/file', 
    name='custom_name.pdf', 
    directory='Uploads',
    workflow='aircraft_title', 
)
Pypi link
https://app.annolab.ai/signup
https://docs.annolab.ai/
https://app.annolab.ai/projects