Export Project

Export projects so that you can train your own ML models

Export Project Files

POST https://api.annolab.ai/v1/export/project

Export requested project details. Each element of the project will have its own "json lines" file and be included in a zip file package.

Headers

NameTypeDescription

Authorization

string

Where you put your api key. Exporting a project requires a key with "Read" permissions. {"Authorization": "Api-Key XXXXXXX-XXXXXXX-XXXXXXX"}

Request Body

NameTypeDescription

includeTextBounds

boolean

boolean of whether you want x,y text bounds of text of any pdfs in project

annotationLayerIds

array

Array of layer ids that you wish to export. defaults to all layers

includeSources

boolean

boolean of whether you want source files to be include with the export. defaults to false

annotationLayerNames

array

Array of strings containing the names of annotation layers you wish to be included in the export. defaults to all layers

projectIdentifier*

string|integer

Identifier for the project that will contain the annotation type. Either the id or the unique name.

includeAnnotationTypes

boolean

Boolean to include annotation types with export. Defaults to false

sourceIds

array

array of source ids to export within the project

{
    headers: {
        'Content-Type': 'application/zip',
        'Content-Disposition': `attachment; filename=New Ner Project.zip`
    }
    content: <byte-stream>
}

This code shows how to request a project export

import requests

ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'

exportRequestBody = {
  'projectIdentifier': 'New NER Project',
  'includeSources': True,
  'includeAnnotationTypes': True,
  'includeTestBounds': False
}

headers = {
  'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}

url = 'https://api.annolab.ai/v1/export/project'

response = requests.post(url, headers=headers, json=exportRequestBody, stream=True)

if r.status_code == 200:
  d = r.headers['content-disposition']
  fileName = re.findall("filename=(.+)", d)[0]
  with open(fileName, 'wb') as f:
    for chunk in r.iter_content(1024):
      f.write(chunk)

Last updated