TeaRex AI Python SDK
This package provides a Python SDK for the tearex.ai Recommendation Engine API. If you don't have a tearex.ai account, you can request one here: tearex.ai.
Documentation
For more information about the API, please refer to the documentation.
Installation
To install the SDK, run the following command:
pip install tearex-ai
Usage
Import the SDK:
import tearex
Initialize the SDK
Provide the url of the API and your API KE as an environment variable TEAREX_URL and TEAREX_API_KEY, or pass them as an argument to the init function:
trx = tearex.Client(uri='YOUR_TEAREX_API_URL', apiKey='YOUR_TEAREX_API_KEY')
Example
import tearex
trx = tearex.Client()
# Define the entities where Alice is a new user and Kale is an existing product.
alice = {"id": "user-1", "label": "User", "properties": {"name": "Alice"}}
kale = {"id": "product-1", "label": "User", "properties": {"name": "Kale"}}
# Create Alice since she is a new user
trx.create_entity(alice)
# Alice purchases Kale, so we create the "Purchased" event
trx.create_event(alice, "Purchased", kale)
# Recommend Alice the next "Product" to purchase
trx.recommend(alice, "Product")
Metadata
Release files for tearex 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tearex-0.1.3.tar.gz | 3.8 kB | Details |
Release files / tearex-0.1.3.tar.gz
| Download URL | tearex-0.1.3.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f60be257bccb5ac64a2742f06e3cc3efad340852c3eaf4ea9f87c8bcb816783
|
|
BLAKE2b-256 checksum How to use checksums |
685bff1d6c374fff1cd6434addd72ce6671166b6c50fcf23ddc2a68895110902
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.12
|