Metadata-Version: 2.5
Name: assethandler-sdk
Version: 2026.1110.1
Summary: Official Python SDK for Assethandler — thin shell over burdenoff-sdk-libs
Project-URL: Homepage, https://github.com/algoshred/assethandler-sdk-python
Project-URL: Documentation, https://docs.algoshred.com/sdk/python
Project-URL: Repository, https://github.com/algoshred/assethandler-sdk-python
Project-URL: Issues, https://github.com/algoshred/assethandler-sdk-python/issues
Project-URL: Changelog, https://github.com/algoshred/assethandler-sdk-python/blob/main/CHANGELOG.md
Author-email: "Vignesh T.V" <vignesh@algoshred.com>
Maintainer-email: "Vignesh T.V" <vignesh@algoshred.com>
License: Copyright (c) 2025 Burdenoff Consultancy Services Private Limited, Algoshred Technologies Private Limited and all sister companies.
        
        All rights reserved.
        
        This software is proprietary and confidential. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited without the express written permission of the copyright holders.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        For licensing inquiries, please contact: legal@algoshred.com
License-File: LICENSE
Keywords: api-client,asset-management,assethandler,burdenoff,graphql,python,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: burdenoff-sdk-libs>=2026.1107.1
Requires-Dist: httpx>=0.24.0
Requires-Dist: typing-extensions>=4.0.0; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: flake8>=6.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx-autodoc-typehints>=1.19.0; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == 'docs'
Requires-Dist: sphinx>=6.0.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
Requires-Dist: pytest>=7.0.0; extra == 'test'
Requires-Dist: respx>=0.21.0; extra == 'test'
Description-Content-Type: text/markdown

# assethandler-sdk

Official Python SDK for **Assethandler** — an enterprise asset-management platform on the Burdenoff platform.

This SDK is a **thin shell** over [`burdenoff-sdk-libs`](https://github.com/algoshred/sdk-libs-python). It mounts the shared platform modules plus the Assethandler domain module and a standalone sandbox module, and exposes them as one ergonomic, fully typed client.

## Features

- Async/await throughout, built on `httpx`
- Dual-endpoint GraphQL client (workspace + global gateways)
- 23 mounted modules: the shared generic set + `assethandler` + `sandbox`
- Multiple auth flows: email/password, device code, PKCE, client credentials
- Automatic token refresh
- Typed error hierarchy
- Full type hints with `py.typed` marker

## Installation

```bash
pip install assethandler-sdk

# Development install
pip install -e ".[dev,test,docs]"
```

## Quick Start

```python
import asyncio
from assethandler_sdk import AssethandlerSDK


async def main():
    # Defaults to the shared prod gateways and the burdenoff_cli_assethandler
    # OIDC client. Override the endpoints for local dev.
    sdk = AssethandlerSDK()

    # Sign in with email/password
    await sdk.auth.sign_in(email="user@example.com", password="secret")

    # Assethandler-domain operations are nested under sdk.assethandler
    assets = await sdk.assethandler.assets.list()
    work_orders = await sdk.assethandler.work_orders.list()

    # Shared cross-product modules are mounted at the top level
    tags = await sdk.tags.list()

    await sdk.close()


asyncio.run(main())
```

## Endpoints

The SDK defaults to the Burdenoff production gateways:

| Endpoint | Default |
|----------|---------|
| Workspace | `https://graphqlworkspaces.burdenoff.com/workspaces/graphql` |
| Global | `https://graphql.burdenoff.com/global/graphql` |

You can override them in three ways, in order of precedence:

1. **Constructor arguments** — highest precedence
2. **Product-specific environment variables** — `ASSETHANDLER_WORKSPACE_ENDPOINT` and `ASSETHANDLER_GLOBAL_ENDPOINT`
3. **Generic environment variables** — `BURDENOFF_WORKSPACE_ENDPOINT` and `BURDENOFF_GLOBAL_ENDPOINT`

```python
from assethandler_sdk import AssethandlerSDK

# Constructor override
sdk = AssethandlerSDK(
    workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
    global_endpoint="https://graphql.burdenoff.com/global/graphql",
)
```

```bash
# Environment override
export ASSETHANDLER_WORKSPACE_ENDPOINT="https://graphqlworkspaces.burdenoff.com/workspaces/graphql"
export ASSETHANDLER_GLOBAL_ENDPOINT="https://graphql.burdenoff.com/global/graphql"
```

## Nested namespace

Per the platform mandate (no compatibility shim), every module surface is nested
under its owning module. The Assethandler domain bundle keeps its sub-entities
nested:

```python
await sdk.assethandler.assets.list()
await sdk.assethandler.assets.get("asset-id")
await sdk.assethandler.work_orders.list()
await sdk.assethandler.maintenance.list()
await sdk.assethandler.incidents.list()
await sdk.assethandler.problems.list()
await sdk.assethandler.changes.list()
await sdk.assethandler.configuration.list()
await sdk.assethandler.discovery.list()
await sdk.assethandler.software.list()
await sdk.assethandler.iot.list()
await sdk.assethandler.digital_twins.list()
await sdk.assethandler.provenance.list()
await sdk.assethandler.predictions.list()
await sdk.assethandler.esg.list()
await sdk.assethandler.knowledge.list()
await sdk.assethandler.finance.transactions()
await sdk.assethandler.compliance.frameworks()
await sdk.assethandler.security.events()
await sdk.assethandler.dashboard.overview()
```

## Modules

All methods are async. The following modules are mounted on the `AssethandlerSDK`
instance: `auth`, `billing`, `channels`, `conversations`, `devportal`,
`export`, `files`, `groups`, `health`, `integrations`, `assethandler`,
`notifications`, `organizations`, `products`, `rbac`, `sandbox`, `scheduler`,
`security`, `store`, `support`, `tags`, `tours`, `workspaces`.

## Configuration

```python
from assethandler_sdk import AssethandlerSDK

sdk = AssethandlerSDK(
    workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
    global_endpoint="https://graphql.burdenoff.com/global/graphql",
    client_id="burdenoff_cli_assethandler",   # default
    oidc_issuer=None,                       # derived from global_endpoint
    api_key=None,
    access_token=None,
    refresh_token=None,
    workspace_token=None,
    timeout=30.0,
    auto_refresh=True,
)
```

## Error Handling

```python
from assethandler_sdk import (
    AssethandlerError,
    AuthenticationError,
    AuthorizationError,
    NetworkError,
    ValidationError,
    RateLimitError,
    DeviceCodeExpiredError,
    DeviceCodeDeniedError,
)

try:
    await sdk.auth.sign_in(email="user@example.com", password="wrong")
except AuthenticationError:
    print("Invalid credentials")
except NetworkError:
    print("Could not reach the API")
except AssethandlerError as e:
    print(f"SDK error: {e}")
```

## Testing

The test suite uses `pytest`, `pytest-asyncio`, and `respx` to mock the
underlying `httpx` client. It covers the full mounted API surface, including
all 23 modules and every method on the Assethandler domain sub-APIs.

```bash
make test          # run tests with coverage
make sanity        # format-check + lint + type-check + test (cov>=80) + build
```

## Development

```bash
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,test,docs]"

make format        # black + isort
make lint          # flake8
make type-check    # mypy (strict)
make test          # pytest
make sanity        # format-check + lint + type-check + test (cov>=80) + build
```

## License

Proprietary — Copyright Burdenoff Consultancy Services Pvt. Ltd.

## Support

- Issues: [GitHub Issues](https://github.com/algoshred/assethandler-sdk-python/issues)
