The official Python library for the Integry API
Project description
Integry Python API Library
The Python API library allows access to Integry REST API from Python programs.
Installation
# install from PyPI
pip install integry
Usage
import os
from integry import Integry
user_id = "your user's ID"
# Initialize the client
integry = Integry(
app_secret=os.environ.get("INTEGRY_APP_KEY"),
app_key=os.environ.get("INTEGRY_APP_SECRET"),
)
# Get the most relevant function
predictions = await integry.functions.predict(
prompt="say hello to my team on Slack", user_id=user_id, predict_arguments=True
)
if predictions:
function = predictions[0]
# Call the function
await function(user_id, function.arguments)
Pagination
List methods are paginated and allow you to iterate over data without handling pagination manually.
from integry import Integry
user_id = "your user's ID"
integry = Integry(
app_secret=os.environ.get("INTEGRY_APP_KEY"),
app_key=os.environ.get("INTEGRY_APP_SECRET"),
)
async for function in integry.functions.list(user_id):
# do something with function
print(function.name)
If you want to control pagination, you can fetch individual pages by using the cursor returned by the previous page.
from integry import Integry
user_id = "your user's ID"
integry = Integry(
app_secret=os.environ.get("INTEGRY_APP_KEY"),
app_key=os.environ.get("INTEGRY_APP_SECRET"),
)
first_page = await integry.apps.list(user_id)
second_page = await integry.apps.list(user_id, cursor=first_page.cursor)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file integry-0.0.2.tar.gz.
File metadata
- Download URL: integry-0.0.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
683391780897cdbee6e704f2164601f927e622f9c37103afbd2c4513c69343ab
|
|
| MD5 |
fe689b72e689f43b0963380b355c3eef
|
|
| BLAKE2b-256 |
569c7042a1665a791f4a608b91d572891072f8ffd2390423d8306871bb3e2b51
|
File details
Details for the file integry-0.0.2-py3-none-any.whl.
File metadata
- Download URL: integry-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
925a3e5f1f9f96ed57051abd165d23f5080f3e4ba2c27f263aa318322a6d24c8
|
|
| MD5 |
3545d8381f87fce909df901df61588da
|
|
| BLAKE2b-256 |
1c442e7abdc229bfdad9d4b80080adc3a23fcc55fe4f372d1111d5fde1827cc6
|