Skip to main content

Python SDK for IntegrationOS API

Project description

IntegrationOS Python SDK

This Python SDK provides a simple and intuitive way to interact with the IntegrationOS API. It allows you to easily integrate IntegrationOS functionality into your Python applications.

Features

  • Simple and intuitive interface for IntegrationOS API operations
  • Support for all CRUD operations (Create, Read, Update, Delete, Count)
  • Built-in error handling and request management
  • Type hints for improved code completion and error checking in IDEs

Installation

You can install the IntegrationOS SDK using pip:

pip install integrationos-sdk

Usage

Here's a quick example of how to use the IntegrationOS SDK:

from integrationos_sdk import IntegrationOS

# Initialize the SDK with your secret key
integrate = IntegrationOS("your_secret_key")

# Create a model instance (e.g., for customers)
customers = integrate("customers", "your_connection_key")

# List customers
customer_list = customers.list({"limit": 10})
print(f"First customer: {customer_list['unified'][0]['firstName']}")

# Create a new customer
new_customer = customers.create({"firstName": "John", "email": "john@example.com"})
print(f"Created customer: {new_customer['unified']['name']}")

# Get a specific customer
customer = customers.get(new_customer['unified']['id'])
print(f"Retrieved customer: {customer['name']}")

# Update a customer
updated_response = customers.update(customer['id'], {"firstName": "Jane"})
print(f"Updated customer: {updated_response}")

# Delete a customer
delete_response = customers.delete(customer['id'])
print(f"Delete response: {delete_response}")

# Count customers
customer_count = customers.count()
print(f"Total customers: {customer_count}")

Available Methods

For each model, the following methods are available:

  • list(params: Optional[Dict[str, Any]] = None) -> List[Dict[str, Any]]
  • create(data: Dict[str, Any]) -> Dict[str, Any]
  • get(id: Union[str, int]) -> Dict[str, Any]
  • update(id: Union[str, int], data: Dict[str, Any]) -> Dict[str, Any]
  • delete(id: Union[str, int]) -> Dict[str, Any]
  • count() -> int

Error Handling

The SDK uses the requests library's built-in error handling. If an HTTP error occurs, a requests.exceptions.HTTPError will be raised. You can catch and handle these exceptions in your code:

from requests.exceptions import HTTPError

try:
    customers.get("non_existent_id")
except HTTPError as e:
    print(f"An error occurred: {e}")

Contributing

Contributions to the IntegrationOS Python SDK are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any problems or have any questions about the SDK, please open an issue on the GitHub repository or contact IntegrationOS support.


Remember to replace "your_secret_key" and "your_connection_key" with your actual IntegrationOS API key and connection key in your code.

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

integrationos_sdk-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

integrationos_sdk-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file integrationos_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: integrationos_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for integrationos_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8296ded5948de34dfe11bc5a62a97cfce4595f206b4f3dcc4e9ec1e5c6351de
MD5 37f75f16f75ca7ae71aa86443c6e0407
BLAKE2b-256 f7fbae3ccc4a01f2b4f6b28406ac5f53108499ec48f7811aabf581838fb9447d

See more details on using hashes here.

File details

Details for the file integrationos_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for integrationos_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71a7cc39ab10e7c9af71428fdc7aec5d6ab3924be159cced563de2beef8de50f
MD5 8d086374d246fbb89edcfa8dc8eededf
BLAKE2b-256 b0fc059b6a5f1fd5fb3d1e364a67dab2dfb542eca26a6b1ed0ba02222165346d

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