airweave-sdk


Nameairweave-sdk JSON
Version 0.3.52 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2025-07-29 12:27:22
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Airweave Python Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fairweave-ai%2Fpython-sdk)
[![pypi](https://img.shields.io/pypi/v/airweave-sdk)](https://pypi.python.org/pypi/airweave-sdk)

The Airweave Python library provides convenient access to the Airweave API from Python.

## Installation

```sh
pip install airweave-sdk
```

## Reference

A full reference for this library is available [here](https://github.com/airweave-ai/python-sdk/blob/HEAD/./reference.md).

## Usage

Instantiate and use the client with the following:

```python
from airweave import AirweaveSDK

client = AirweaveSDK(
    api_key="YOUR_API_KEY",
    organization_id="YOUR_ORGANIZATION_ID",
)
client.collections.create_collection(
    name="Finance Data",
    readable_id="finance-data-reports",
)
```

## Async Client

The SDK also exports an `async` client so that you can make non-blocking calls to our API.

```python
import asyncio

from airweave import AsyncAirweaveSDK

client = AsyncAirweaveSDK(
    api_key="YOUR_API_KEY",
    organization_id="YOUR_ORGANIZATION_ID",
)


async def main() -> None:
    await client.collections.create_collection(
        name="Finance Data",
        readable_id="finance-data-reports",
    )


asyncio.run(main())
```

## Exception Handling

When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
will be thrown.

```python
from airweave.core.api_error import ApiError

try:
    client.collections.create_collection(...)
except ApiError as e:
    print(e.status_code)
    print(e.body)
```

## Advanced

### Access Raw Response Data

The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.

```python
from airweave import AirweaveSDK

client = AirweaveSDK(
    ...,
)
response = client.collections.with_raw_response.create_collection(...)
print(response.headers)  # access the response headers
print(response.data)  # access the underlying object
```

### Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
retry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:

- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)

Use the `max_retries` request option to configure this behavior.

```python
client.collections.create_collection(..., request_options={
    "max_retries": 1
})
```

### Timeouts

The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.

```python

from airweave import AirweaveSDK

client = AirweaveSDK(
    ...,
    timeout=20.0,
)


# Override timeout for a specific method
client.collections.create_collection(..., request_options={
    "timeout_in_seconds": 1
})
```

### Custom Client

You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
and transports.

```python
import httpx
from airweave import AirweaveSDK

client = AirweaveSDK(
    ...,
    httpx_client=httpx.Client(
        proxies="http://my.test.proxy.example.com",
        transport=httpx.HTTPTransport(local_address="0.0.0.0"),
    ),
)
```

## Contributing

While we value open-source contributions to this SDK, this library is generated programmatically.
Additions made directly to this library would have to be moved over to our generation code,
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "airweave-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/cc/5a/19a7b38dfde536c6cb8534ad1b32b74271a100a170917e326a4822c53553/airweave_sdk-0.3.52.tar.gz",
    "platform": null,
    "description": "# Airweave Python Library\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fairweave-ai%2Fpython-sdk)\n[![pypi](https://img.shields.io/pypi/v/airweave-sdk)](https://pypi.python.org/pypi/airweave-sdk)\n\nThe Airweave Python library provides convenient access to the Airweave API from Python.\n\n## Installation\n\n```sh\npip install airweave-sdk\n```\n\n## Reference\n\nA full reference for this library is available [here](https://github.com/airweave-ai/python-sdk/blob/HEAD/./reference.md).\n\n## Usage\n\nInstantiate and use the client with the following:\n\n```python\nfrom airweave import AirweaveSDK\n\nclient = AirweaveSDK(\n    api_key=\"YOUR_API_KEY\",\n    organization_id=\"YOUR_ORGANIZATION_ID\",\n)\nclient.collections.create_collection(\n    name=\"Finance Data\",\n    readable_id=\"finance-data-reports\",\n)\n```\n\n## Async Client\n\nThe SDK also exports an `async` client so that you can make non-blocking calls to our API.\n\n```python\nimport asyncio\n\nfrom airweave import AsyncAirweaveSDK\n\nclient = AsyncAirweaveSDK(\n    api_key=\"YOUR_API_KEY\",\n    organization_id=\"YOUR_ORGANIZATION_ID\",\n)\n\n\nasync def main() -> None:\n    await client.collections.create_collection(\n        name=\"Finance Data\",\n        readable_id=\"finance-data-reports\",\n    )\n\n\nasyncio.run(main())\n```\n\n## Exception Handling\n\nWhen the API returns a non-success status code (4xx or 5xx response), a subclass of the following error\nwill be thrown.\n\n```python\nfrom airweave.core.api_error import ApiError\n\ntry:\n    client.collections.create_collection(...)\nexcept ApiError as e:\n    print(e.status_code)\n    print(e.body)\n```\n\n## Advanced\n\n### Access Raw Response Data\n\nThe SDK provides access to raw response data, including headers, through the `.with_raw_response` property.\nThe `.with_raw_response` property returns a \"raw\" client that can be used to access the `.headers` and `.data` attributes.\n\n```python\nfrom airweave import AirweaveSDK\n\nclient = AirweaveSDK(\n    ...,\n)\nresponse = client.collections.with_raw_response.create_collection(...)\nprint(response.headers)  # access the response headers\nprint(response.data)  # access the underlying object\n```\n\n### Retries\n\nThe SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long\nas the request is deemed retryable and the number of retry attempts has not grown larger than the configured\nretry limit (default: 2).\n\nA request is deemed retryable when any of the following HTTP status codes is returned:\n\n- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)\n- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)\n- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)\n\nUse the `max_retries` request option to configure this behavior.\n\n```python\nclient.collections.create_collection(..., request_options={\n    \"max_retries\": 1\n})\n```\n\n### Timeouts\n\nThe SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.\n\n```python\n\nfrom airweave import AirweaveSDK\n\nclient = AirweaveSDK(\n    ...,\n    timeout=20.0,\n)\n\n\n# Override timeout for a specific method\nclient.collections.create_collection(..., request_options={\n    \"timeout_in_seconds\": 1\n})\n```\n\n### Custom Client\n\nYou can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies\nand transports.\n\n```python\nimport httpx\nfrom airweave import AirweaveSDK\n\nclient = AirweaveSDK(\n    ...,\n    httpx_client=httpx.Client(\n        proxies=\"http://my.test.proxy.example.com\",\n        transport=httpx.HTTPTransport(local_address=\"0.0.0.0\"),\n    ),\n)\n```\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nAdditions made directly to this library would have to be moved over to our generation code,\notherwise they would be overwritten upon the next generated release. Feel free to open a PR as\na proof of concept, but know that we will not be able to merge it as-is. We suggest opening\nan issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.3.52",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22889460c35d5110540db1688a065683dde6cab40df747bc9751da2b89eda810",
                "md5": "c6a81b5bcef86f04c161d95f92def1a8",
                "sha256": "24080717e5a74e0a5387df2dc22c1f13fe750858427445539b989df19ae6a306"
            },
            "downloads": -1,
            "filename": "airweave_sdk-0.3.52-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6a81b5bcef86f04c161d95f92def1a8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 120349,
            "upload_time": "2025-07-29T12:27:21",
            "upload_time_iso_8601": "2025-07-29T12:27:21.593410Z",
            "url": "https://files.pythonhosted.org/packages/22/88/9460c35d5110540db1688a065683dde6cab40df747bc9751da2b89eda810/airweave_sdk-0.3.52-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc5a19a7b38dfde536c6cb8534ad1b32b74271a100a170917e326a4822c53553",
                "md5": "31827e537e0489c5468b15f5af891c27",
                "sha256": "f80eb7665fd24772b5d101be57bddd9fb992c95df79bb4300587abc5efc6db38"
            },
            "downloads": -1,
            "filename": "airweave_sdk-0.3.52.tar.gz",
            "has_sig": false,
            "md5_digest": "31827e537e0489c5468b15f5af891c27",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 53438,
            "upload_time": "2025-07-29T12:27:22",
            "upload_time_iso_8601": "2025-07-29T12:27:22.621473Z",
            "url": "https://files.pythonhosted.org/packages/cc/5a/19a7b38dfde536c6cb8534ad1b32b74271a100a170917e326a4822c53553/airweave_sdk-0.3.52.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 12:27:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "airweave-sdk"
}
        
Elapsed time: 0.82223s