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

"api_url" is and optional parameter for private installs

from pprint import pprint
from objectways import newton

client = newton.Newton(api_url="YOUR_API_URL",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.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: newton-api-client-1.0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.8

File hashes

Hashes for newton-api-client-1.0.4.tar.gz
Algorithm Hash digest
SHA256 088ee4c489f71b5e5882bd3f25c21e24e12c00111bb5780fcfe142df65b0aeae
MD5 af0cc5cc18222724f86efc82b837384b
BLAKE2b-256 d40cfb81975ae914f553ca59a8f74a2b5c4aefb3323fc68324c1a4af850d1e5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: newton_api_client-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.8

File hashes

Hashes for newton_api_client-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 974bbf000929c2908ca5baebee29bcd88945e1180a2714838d083c374b207649
MD5 d10c5b31f4ee54f31ffa0a6104cf68eb
BLAKE2b-256 92764f5d9e16f3150823c344bff5ade6faf98a93d9868956110c29380ff3075c

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