Skip to main content

Alloy Python SDK (AI generated)

This is a library to interact with Alloy's APIs. This library supports Alloy Embedded.

Documentation

Visit the Alloy Docs site for more information on how to get started with Alloy APIs.

SDK Installation

You can install the SDK by cloning this repo or running

pip3 install git+https://github.com/onedebos/alloy-python-sdk-ai.git [--break-system-packages]

SDK Example Usage

Example

import alloypythonsdk
from alloypythonsdk.models import operations

s = alloypythonsdk.AlloyPythonSDK(
    api_key="bearer <YOUR_API_KEY_HERE>",
)


res = s.update_a_user(user_id='<value>', request_body=operations.UpdateAUserRequestBody())

if res.object is not None:
    # handle response
    pass

Available Resources and Operations

AlloyPythonSDK

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.

Error Object Status Code Content Type
errors.UpdateAUserResponseBody 401 application/json
errors.SDKError 4xx-5xx /

Example

import alloypythonsdk
from alloypythonsdk.models import errors, operations

s = alloypythonsdk.AlloyPythonSDK(
    api_key="bearer <YOUR_API_KEY_HERE>",
)

res = None
try:
    res = s.update_a_user(user_id='<value>', request_body=operations.UpdateAUserRequestBody())

except errors.UpdateAUserResponseBody as e:
    # handle exception
    raise(e)
except errors.SDKError as e:
    # handle exception
    raise(e)

if res.object is not None:
    # handle response
    pass

Server Selection

Select Server by Index

You can override the default server globally by passing a server index to the server_idx: int optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables
0 https://embedded.runalloy.com/2024-03/ None

Example

import alloypythonsdk
from alloypythonsdk.models import operations

s = alloypythonsdk.AlloyPythonSDK(
    server_idx=0,
    api_key="bearer <YOUR_API_KEY_HERE>",
)


res = s.update_a_user(user_id='<value>', request_body=operations.UpdateAUserRequestBody())

if res.object is not None:
    # handle response
    pass

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:

import alloypythonsdk
from alloypythonsdk.models import operations

s = alloypythonsdk.AlloyPythonSDK(
    server_url="https://embedded.runalloy.com/2024-03/",
    api_key="bearer <YOUR_API_KEY_HERE>",
)


res = s.update_a_user(user_id='<value>', request_body=operations.UpdateAUserRequestBody())

if res.object is not None:
    # handle response
    pass

Custom HTTP Client

The Python SDK makes API calls using the requests HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session object.

For example, you could specify a header for every request that this sdk makes as follows:

import alloypythonsdk
import requests

http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = alloypythonsdk.AlloyPythonSDK(client=http_client)

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
api_key apiKey API key

To authenticate with the API the api_key parameter must be set when initializing the SDK client instance. For example:

import alloypythonsdk
from alloypythonsdk.models import operations

s = alloypythonsdk.AlloyPythonSDK(
    api_key="bearer <YOUR_API_KEY_HERE>",
)


res = s.update_a_user(user_id='<value>', request_body=operations.UpdateAUserRequestBody())

if res.object is not None:
    # handle response
    pass

Development

This repository includes components generated by Speakeasy based on this OpenAPI spec, as well as human authored code that simplifies usage.

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy

Release files for alloy-python-sdk-ai 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alloy-python-sdk-ai 0.0.1
File Size Uploaded
alloy_python_sdk_ai-0.0.1.tar.gz 30.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alloy-python-sdk-ai 0.0.1
File Interpreter ABI Platform
alloy_python_sdk_ai-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 97.1 kB

Release files / alloy_python_sdk_ai-0.0.1.tar.gz

Download URL alloy_python_sdk_ai-0.0.1.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e5a4b75173cde22b8f7f149afe3ecdb1cfdf0eacc2ac75270f6b3d35c75dd613
BLAKE2b-256 checksum
How to use checksums
52bd0d4e5ea9a3564cf38e5cbe08899b116a62f8328a5002c374e256eca1a8b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / alloy_python_sdk_ai-0.0.1-py3-none-any.whl

Download URL alloy_python_sdk_ai-0.0.1-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5ce6b788f80cf5b698922f4bfd3bebca733175b57303f7b5964b9dd065179c0
BLAKE2b-256 checksum
How to use checksums
566d44774912a798bc5ff3f05e62e71641b3c7d06da56d45b3d7c652b4a76ec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page