Metadata-Version: 2.5
Name: burdenoff-sdk-libs
Version: 2026.1115.2
Summary: Modular SDK library shared across all Burdenoff product SDKs (Python). Each module exposes attach(ctx) returning a typed API; product SDKs pick which modules to mount. Sister to @burdenoff/cli-sdk.
Project-URL: Homepage, https://github.com/algoshred/sdk-libs-python
Project-URL: Repository, https://github.com/algoshred/sdk-libs-python
Project-URL: Issues, https://github.com/algoshred/sdk-libs-python/issues
Author-email: "Vignesh T.V" <vignesh@burdenoff.com>
Maintainer-email: "Vignesh T.V" <vignesh@burdenoff.com>
License: Copyright (c) 2026 Burdenoff Consultancy Services Private Limited, Algoshred Technologies Private Limited and all sister companies.
        All rights reserved.
        
        Proprietary software. Unauthorized use, distribution, or modification is prohibited.
License-File: LICENSE
Keywords: burdenoff,graphql,modular,python,sdk,sdk-libs
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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.24.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: typing-extensions>=4.0.0; python_version < '3.11'
Provides-Extra: codegen
Requires-Dist: ariadne-codegen>=0.13.0; extra == 'codegen'
Provides-Extra: dev
Requires-Dist: ariadne-codegen>=0.13.0; extra == 'dev'
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: flake8>=6.0.0; extra == 'dev'
Requires-Dist: graphql-core<3.3,>=3.2; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.7.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'
Requires-Dist: respx>=0.21.0; extra == 'dev'
Requires-Dist: websockets>=13.1; extra == 'dev'
Provides-Extra: subscriptions
Requires-Dist: websockets>=13.1; extra == 'subscriptions'
Provides-Extra: test
Requires-Dist: httpx[testing]>=0.24.0; 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'
Requires-Dist: websockets>=13.1; extra == 'test'
Provides-Extra: ws
Requires-Dist: httpx-ws>=0.6.0; extra == 'ws'
Description-Content-Type: text/markdown

# burdenoff-sdk-libs

Modular SDK library shared across all Burdenoff product SDKs (Python).

Each module under `src/burdenoff_sdk_libs/modules/<name>/` exports an `SdkModule` (a dataclass with `attach(ctx) -> API`). Product SDKs (`vibecontrols-sdk-python`, `botlit-sdk-python`, etc.) become thin shells that pick which modules to mount. Sister to [`@burdenoff/sdk-libs`](https://github.com/algoshred/sdk-libs-node) (Node) and [`@burdenoff/cli-sdk`](https://github.com/algoshred/cli-sdk).

## HeadshotMarketing social connection migration

Social account creation and updates use `integration_connection_id` (serialized as `integrationConnectionId`) to reference a connection owned by the integrations service. Complete the provider connection flow there first; do not send provider credentials to HeadshotMarketing. The retired `access_token` and `refresh_token` constructor arguments now raise `TypeError`. Dynamically attached legacy credential attributes, including camel-case spellings, raise the SDK's `ValidationError` before HTTP without including their values in the error.

Use `delivery_mode` (`API`, `INTERNAL`, or `WEBHOOK`) and `webhook_url` where the backend supports that delivery path. `token_expires_at`, `metadata`, profile fields and follower counts remain supported. The SDK's own session authentication token is separate and unchanged. This source change is not evidence of registry publication or deployed connection acceptance.

## FluidGrids usage summary migration

`fluidgrids.usage.billing_summary()` and `FluidgridsBillingSummary` are removed; use `fluidgrids.usage.workflow_usage_summary()` and `FluidgridsWorkflowUsageSummary` (BOFF-5339). The workflow service removed the `billingSummary` query and its `estimatedCost`, which priced node minutes at a hard-coded example rate; usage charges belong to the billing service. The deprecated alias the previous release kept has been removed too. The replacement takes the same date range and returns the same counters, with no cost figure. Details: [`docs/fluidgrids.md`](docs/fluidgrids.md#removed-apis).

## Architecture

- **Core** (`src/burdenoff_sdk_libs/core/`): `SdkContext`, `SdkModule` Protocol, dual-gateway `BaseGraphQLClient` (workspace + global), `AuthStore` with pluggable `TokenStore` (`InMemoryTokenStore`, `FileTokenStore`, `EnvTokenStore`), error hierarchy with token redaction, structured logger, `ModuleRegistry`.
- **Modules** (`src/burdenoff_sdk_libs/modules/<name>/`): `__init__.py` exports `SdkModule` instance. `operations.py` holds hand-written GraphQL doc strings. `api.py` builds the API. Generated types land at `src/burdenoff_sdk_libs/modules/<name>/__generated__/types.py` (gitignored).
- **PEP 562 lazy imports**: top-level `__getattr__` defers module loading until first access (lambda/edge cold-start friendly).
- **Hard rules**: Modules NEVER import each other directly — use `ctx.modules.get('id')`. Modules NEVER print, raise plain `Exception`, or log secrets unredacted.

## Build & Commands

```bash
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest                            # unit tests
pytest --cov                      # with coverage
python scripts/codegen.py         # generate types from pinned supergraph
python scripts/parity_check.py    # cross-language manifest diff vs sdk-libs-node
python -m build                   # sdist + wheel
```

## Adding a module

1. `mkdir src/burdenoff_sdk_libs/modules/<id>` with `__init__.py`, `operations.py`, `api.py`, `types.py`.
2. Export `SdkModule` instance from `__init__.py` (e.g. `auth_module = AuthModule()`).
3. Add to `_LAZY_MODULES` in top-level `__init__.py` if surfacing at package root.
4. Add manifest entry to `schema/modules.yaml`.
5. Mirror in `~/products/sdk-libs-node/` in the SAME PR pair.

## Testing

- Unit (`tests/test_*.py`): pure logic. No HTTP. pytest, <5s.
- Integration: respx intercepts HTTP. Mock factories derived from `__generated__/types.py`.
- E2E: real svc + state, run nightly.
- Parity: same `tests/parity/<scenario>.yaml` run by node + python.

## Reference

- `~/products/sdk-libs-node/` — sister Node library.
- `~/products/cli-sdk/` — sister CLI library.
- `~/products/vibecontrols/vibecontrols-sdk-python/` — first consumer (thin shell).
- `~/products/dev/audit/index/vibecontrols.md` — 23-module ground-truth.
- [`docs/fluidgrids.md`](docs/fluidgrids.md) — the FluidGrids module: authentication, errors and misses, retries, following a run live, paging, secrets, quirks.
