Skip to main content

Python SDK for the TQNN AnyEngine API

Project description

TQNN SDK

Python SDK for the TQNN AnyEngine API.

Access TQNN's cloud-hosted inference engine through a simple Python interface.


Installation

pip install tqnn


Quick Start

from tqnn import TQNNClient

client = TQNNClient( api_key="TQNN_xxxxxxxxxxxxxxxxx", base_url="[https://tqnn-anyengine-api-914075492772.northamerica-northeast1.run.app]" )

result = client.run_any( data=[1, 2, 3, 4], mode="ANY" )

print(result)


Supported Modes

Mode| Description ANY| Automatic inference EEG| EEG and biosignal analysis FINANCE| Financial data analysis CHEM| Molecular and chemistry analysis TEXT| Text inference TABULAR| Structured data analysis IMAGE| Image feature analysis


Authentication

Every request requires a valid TQNN API key.

client = TQNNClient( api_key="TQNN_xxxxxxxxxxxxxxxxx", base_url="https://tqnn-anyengine-api-914075492772.northamerica-northeast1.run.app" )

API keys are issued after subscribing through TQNN Labs.


Basic Usage

from tqnn import TQNNClient

client = TQNNClient( api_key="TQNN_xxxxxxxxxxxxxxxxx", base_url="[https://tqnn-anyengine-api-914075492772.northamerica-northeast1.run.app]" )

result = client.run_any( data=[1, 2, 3, 4], mode="ANY" )

print(result)


EEG Example

result = client.run_any( data=eeg_samples, mode="EEG", sfreq=250 )


Finance Example

result = client.run_any( data={ "rsi": 63.2, "macd": 1.12, "slope": 0.05 }, mode="FINANCE" )


Chemistry Example

result = client.run_any( data="CCO", mode="CHEM" )


Optional Parameters

result = client.run_any( data=my_data, mode="ANY", label="sample", metadata={ "source": "demo" } )


API Reference

client.run_any( data, mode="ANY", label=None, metadata=None, sfreq=None )

Parameters

Parameter| Description data| Input data for inference mode| ANY, EEG, FINANCE, CHEM, TEXT, TABULAR, IMAGE label| Optional sample label metadata| Optional metadata dictionary sfreq| Sampling frequency for EEG data


Example Response

{ "prediction": "class_a", "confidence": 0.94, "mode": "ANY" }


Status

TQNN SDK Version: 0.1.0

Public API: Active

Supported Modes:

  • ANY
  • EEG
  • FINANCE
  • CHEM
  • TEXT
  • TABULAR
  • IMAGE

Requirements

  • Python 3.9+
  • requests >= 2.31.0

License

MIT License

Copyright (c) TQNN Labs


TQNN SDK provides access to the TQNN AnyEngine API.

The underlying inference engine, backend infrastructure, and proprietary computational methods remain the intellectual property of TQNN Labs.

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

tqnn-0.1.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqnn-0.1.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file tqnn-0.1.2.tar.gz.

File metadata

  • Download URL: tqnn-0.1.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tqnn-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e989bc75c64e211dc5dc2a5be4523eba61442187d7e29d77dd8bfb96399d4405
MD5 2d7d358751de893ad0e59fdfb59613a5
BLAKE2b-256 aa04cfe41a23f35a98ddfeb42257c61e69ee7115cb458e231eb33988c9584eef

See more details on using hashes here.

File details

Details for the file tqnn-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tqnn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tqnn-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe96742534c5c999b5abc649bcadf60fe00bad0da412657db1970dac48917f9a
MD5 3eafbf9edd2f7c5828f198f3b9ef91d3
BLAKE2b-256 31ac9fcdd3ae334ffa3b9219e8034b63f5184439880fbcaa53b0677ef144563d

See more details on using hashes here.

Supported by

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