borneo-client-python


Nameborneo-client-python JSON
Version 3.18.0 PyPI version JSON
download
home_pageNone
Summaryborneo_client_python client
upload_time2025-02-17 11:56:34
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseApache-2.0
keywords smithy borneo_client_python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # borneo-client-python

Borneo Client Python SDK

## Installing

To install the this package, simply add or install using your favorite package manager and dependent packages:

- `pip install borneo-client-python`
- `pip install boto3`
- `pip install PyJWT`

### Usage

To send a request using `borneo-client-python` and an example command:

```python
import asyncio
from borneo_client_python.client import Borneo
from borneo_client_python.config import Config, IdentityResolver, ApiKeyIdentity, IdentityProperties, ApiKeyIdentity
from borneo_client_python.models import ListLogsInput, ListLogsFilter
from borneo_auth_provider import borneo_auth_provider
from smithy_http.aio.aiohttp import AIOHTTPClient

# Replace the service account key file location
auth_provider = borneo_auth_provider.BorneoAuthProviderConfig.fromConfigFile('../Borneo-Service-Account-Token.json')

class ApiKeyIdentityResolver(IdentityResolver[ApiKeyIdentity, IdentityProperties]):
    async def get_identity(self, identity_properties) -> ApiKeyIdentity:
        token = auth_provider.get_api_key()
        return ApiKeyIdentity(api_key=token)
        
async def main() -> None:
    http_client = AIOHTTPClient()
    endpoint_uri = auth_provider.get_api_endpoint()
    client = Borneo(Config(endpoint_uri=endpoint_uri, api_key_identity_resolver=ApiKeyIdentityResolver(), retry_strategy=None, http_client=http_client))

    # Payload inputs
    input = ListLogsInput(filter=ListLogsFilter(search='<text>'))
    data = await client.list_logs(input)

    # Data output here
    print(data)

    await http_client._session.close()

if __name__ == "__main__":
    asyncio.run(main())
```

### Config
```
const config = {
  clientId: 'STRING_VALUE', /* required */
  region: 'STRING_VALUE', /* required */
  token: 'STRING_VALUE', /* required */
  apiEndpoint: 'STRING_VALUE', /* required */
  secret: 'STRING_VALUE'
}
```

## API Documentation

More API documentation is here at `https://<my-stack>/docs/api`

## License

This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "borneo-client-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "smithy, borneo_client_python",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/eb/a1/e07e8ec7e493935dd3b0773f458c3880e81dee5d1df8b838d130298ff4b1/borneo_client_python-3.18.0.tar.gz",
    "platform": null,
    "description": "# borneo-client-python\n\nBorneo Client Python SDK\n\n## Installing\n\nTo install the this package, simply add or install using your favorite package manager and dependent packages:\n\n- `pip install borneo-client-python`\n- `pip install boto3`\n- `pip install PyJWT`\n\n### Usage\n\nTo send a request using `borneo-client-python` and an example command:\n\n```python\nimport asyncio\nfrom borneo_client_python.client import Borneo\nfrom borneo_client_python.config import Config, IdentityResolver, ApiKeyIdentity, IdentityProperties, ApiKeyIdentity\nfrom borneo_client_python.models import ListLogsInput, ListLogsFilter\nfrom borneo_auth_provider import borneo_auth_provider\nfrom smithy_http.aio.aiohttp import AIOHTTPClient\n\n# Replace the service account key file location\nauth_provider = borneo_auth_provider.BorneoAuthProviderConfig.fromConfigFile('../Borneo-Service-Account-Token.json')\n\nclass ApiKeyIdentityResolver(IdentityResolver[ApiKeyIdentity, IdentityProperties]):\n    async def get_identity(self, identity_properties) -> ApiKeyIdentity:\n        token = auth_provider.get_api_key()\n        return ApiKeyIdentity(api_key=token)\n        \nasync def main() -> None:\n    http_client = AIOHTTPClient()\n    endpoint_uri = auth_provider.get_api_endpoint()\n    client = Borneo(Config(endpoint_uri=endpoint_uri, api_key_identity_resolver=ApiKeyIdentityResolver(), retry_strategy=None, http_client=http_client))\n\n    # Payload inputs\n    input = ListLogsInput(filter=ListLogsFilter(search='<text>'))\n    data = await client.list_logs(input)\n\n    # Data output here\n    print(data)\n\n    await http_client._session.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### Config\n```\nconst config = {\n  clientId: 'STRING_VALUE', /* required */\n  region: 'STRING_VALUE', /* required */\n  token: 'STRING_VALUE', /* required */\n  apiEndpoint: 'STRING_VALUE', /* required */\n  secret: 'STRING_VALUE'\n}\n```\n\n## API Documentation\n\nMore API documentation is here at `https://<my-stack>/docs/api`\n\n## License\n\nThis SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "borneo_client_python client",
    "version": "3.18.0",
    "project_urls": null,
    "split_keywords": [
        "smithy",
        " borneo_client_python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4c3b7d311484c57629e76aa23e6963c5f2227e5f3916229fd873310e2313c2c5",
                "md5": "ee5b12c6e302dba7cb238f47660742d1",
                "sha256": "3ab9ca872927a8212898de2c3b6c6c2a258dd01a1294d116a287a472af02eff7"
            },
            "downloads": -1,
            "filename": "borneo_client_python-3.18.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ee5b12c6e302dba7cb238f47660742d1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 210615,
            "upload_time": "2025-02-17T11:56:32",
            "upload_time_iso_8601": "2025-02-17T11:56:32.315959Z",
            "url": "https://files.pythonhosted.org/packages/4c/3b/7d311484c57629e76aa23e6963c5f2227e5f3916229fd873310e2313c2c5/borneo_client_python-3.18.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "eba1e07e8ec7e493935dd3b0773f458c3880e81dee5d1df8b838d130298ff4b1",
                "md5": "7b107fa5d63004a45e22ce84e78d9e7b",
                "sha256": "501a1a4ff32c64c1526fbf00970078418666436c93a7e3bc958e4d0c50a1597e"
            },
            "downloads": -1,
            "filename": "borneo_client_python-3.18.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7b107fa5d63004a45e22ce84e78d9e7b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 191298,
            "upload_time": "2025-02-17T11:56:34",
            "upload_time_iso_8601": "2025-02-17T11:56:34.895435Z",
            "url": "https://files.pythonhosted.org/packages/eb/a1/e07e8ec7e493935dd3b0773f458c3880e81dee5d1df8b838d130298ff4b1/borneo_client_python-3.18.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-17 11:56:34",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "borneo-client-python"
}
        
Elapsed time: 1.75963s