Skip to main content

Python api client - https://api.objectways.com/docs

Project description

Newton API client

This is python package to call all API from (https://api.objectways.com/docs)

Import package and create a client

from pprint import pprint
from objectways import newton

client = newton.Newton(api_key="YOUR_API_KEY")

1. Task

1.1. Add new task

body = {
  "project_id": "449354de1168469a8229f605",
  "file_name": "document.pdf",
  "file_type": "application/pdf",
  "source": "s3://examples/pdfs/document.pdf"
}

pprint(client.add_task(body))

1.2. Add task file

data = client.add_task_file(
    project_id="449354de1168469a8229f605", 
    file_path="examples/pdfs/document.pdf",
    mime_type="application/pdf",
    annotations=None
)

pprint(data)

1.3. Find task by Filters

  • Find all the tasks by task_id, file_name, file_type and trail
  • If all of task_id, file_name, file_type are None, it will return all possible tasks
tasks = client.find_task(
    project_id="449354de1168469a8229f605", 
    task_id="449354de1168469a8229f605-0",
    file_name=None,
    file_type=None,
    trail = False
)

pprint(tasks)

2. Project

2.1. Add a new project

body = {
  "project_name": "TestProject",
  "project_type": "NER",
  "enable_text_mode_option": true,
  "disable_quality_audit": true,
  ...
}
# check API docs for the full body: https://api.objectways.com/docs/#/projects/upload_project

pprint(client.add_project(body))

2.2. Find projects by Filters

  • Find all the projects by project_id, project_name or active
  • If all of project_id, project_name, active are None, it will return all possible projects
projects = client.find_project(
    project_id="449354de1168469a8229f605", 
    project_name=None, 
    active: bool=None
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newton-api-client-1.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

newton_api_client-1.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file newton-api-client-1.0.1.tar.gz.

File metadata

  • Download URL: newton-api-client-1.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for newton-api-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 58b6822acdbf11df21878c76b3bc031b78a6e3a53e8e9a103c3ada64d35b6ed8
MD5 1657e93e939ba8ab3ff807106b6a8a90
BLAKE2b-256 0deefe79e0886495eb9cf1a709e8899e293e4297e851d7e309d668cafb3d8681

See more details on using hashes here.

File details

Details for the file newton_api_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: newton_api_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for newton_api_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46561ea1495624701a624fd18e9f7e049c84239e3fb6c332d733e66c2d4f23cb
MD5 91ded805fc4b52c6535c0e9c70dc2d83
BLAKE2b-256 ee18d5aae6f3ee5945380f0bf64b62a0dd9aa77b66219503b1fe8597c8122f13

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page