Skip to main content

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


Download files

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

Source Distribution

integry-0.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

integry-0.0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file integry-0.0.1.tar.gz.

File metadata

  • Download URL: integry-0.0.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for integry-0.0.1.tar.gz
Algorithm Hash digest
SHA256 eee300f804a24047898621aa27c759dd8e17c9cb0ec6e7f2e1c29f8e9676bf0c
MD5 123828d90c19ed515f97be4cc9a02a89
BLAKE2b-256 df1a41238f9570191a898b684fc200bc9114461b68133d7c79fd8c98e8d0d006

See more details on using hashes here.

File details

Details for the file integry-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: integry-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for integry-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19a58f7b91bd677963f77a7b9fd13ce4db4b613ea729290437f4b64c0e8e9575
MD5 e0bcb50dd9cbe1495f215118845d91b0
BLAKE2b-256 9909f413cd006bedf31932d1a8b35fdd986d09c8d957cfc9b5feb277f7fb5fa9

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