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

Request Body

{
    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