Metadata-Version: 2.5
Name: brainyrich-sdk
Version: 2026.1110.1
Summary: Official Python SDK for Brainyrich — thin shell over burdenoff-sdk-libs
Project-URL: Homepage, https://github.com/algoshred/brainyrich-sdk-python
Project-URL: Documentation, https://docs.algoshred.com/sdk/python
Project-URL: Repository, https://github.com/algoshred/brainyrich-sdk-python
Project-URL: Issues, https://github.com/algoshred/brainyrich-sdk-python/issues
Project-URL: Changelog, https://github.com/algoshred/brainyrich-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, Timecampus Technologies Pvt. Ltd. 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@burdenoff.com
License-File: LICENSE
Keywords: api-client,brainyrich,burdenoff,graphql,python,sdk,wealth-management
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: build>=1.2.2; 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

# brainyrich-sdk

Official Python SDK for **Brainyrich** — a wealth-management platform on the Burdenoff platform.

> **Pre-launch notice:** Brainyrich is launching in 2026. This package is published ahead of general availability so integrators can build early. There is no live production service yet — [join the waitlist at brainyrich.com](https://brainyrich.com) to get early access.

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 Brainyrich 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 + `brainyrich` + `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 brainyrich-sdk

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

## Quick Start

```python
import asyncio
from brainyrich_sdk import BrainyrichSDK


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

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

    # Brainyrich-domain operations are nested under sdk.brainyrich
    households = await sdk.brainyrich.households.list()
    portfolios = await sdk.brainyrich.portfolios.list()

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

    await sdk.close()


asyncio.run(main())
```

## Nested namespace

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

```python
await sdk.brainyrich.households.list()
await sdk.brainyrich.accounts.list()
await sdk.brainyrich.holdings.list()
await sdk.brainyrich.transactions.list()
await sdk.brainyrich.portfolios.list()
await sdk.brainyrich.model_portfolios.list()
await sdk.brainyrich.goals.list()
await sdk.brainyrich.insights.list()
await sdk.brainyrich.rebalances.list()
await sdk.brainyrich.analytics.net_worth_summary()
await sdk.brainyrich.system.health()
```

## Modules

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

## Configuration

```python
from brainyrich_sdk import BrainyrichSDK

sdk = BrainyrichSDK(
    workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
    global_endpoint="https://graphql.burdenoff.com/global/graphql",
    client_id="burdenoff_cli_brainyrich",   # 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 brainyrich_sdk import (
    BrainyrichError,
    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 BrainyrichError as e:
    print(f"SDK error: {e}")
```

## Development

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

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/brainyrich-sdk-python/issues)
