Metadata-Version: 2.5
Name: theglobalfuel-sdk
Version: 2026.1123.1
Summary: Official Python SDK for Theglobalfuel — thin shell over burdenoff-sdk-libs
Project-URL: Homepage, https://github.com/algoshred/theglobalfuel-sdk-python
Project-URL: Documentation, https://docs.algoshred.com/sdk/python
Project-URL: Repository, https://github.com/algoshred/theglobalfuel-sdk-python
Project-URL: Issues, https://github.com/algoshred/theglobalfuel-sdk-python/issues
Project-URL: Changelog, https://github.com/algoshred/theglobalfuel-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,burdenoff,energy-commodities,graphql,python,sdk,theglobalfuel
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

# theglobalfuel-sdk

Official Python SDK for **Theglobalfuel** — upstream energy & commodities operations on the Burdenoff platform.

> **Pre-launch notice:** Theglobalfuel 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 theglobalfuel.com](https://theglobalfuel.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 Theglobalfuel 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 + `theglobalfuel` + `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 theglobalfuel-sdk

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

## Quick Start

```python
import asyncio
import os

from burdenoff_sdk_libs.modules.auth.types import SignInInput

from theglobalfuel_sdk import TheglobalfuelSDK


async def main():
    # Defaults to the shared production gateways. Override endpoints for local dev
    # via workspace_endpoint / global_endpoint or THEGLOBALFUEL_* env vars.
    sdk = TheglobalfuelSDK()

    try:
        await sdk.auth.sign_in(
            SignInInput(
                username=os.environ["THEGLOBALFUEL_EMAIL"],
                password=os.environ["THEGLOBALFUEL_PASSWORD"],
            )
        )
        await sdk.auth.issue_workspace_token(
            workspace_id=os.environ["THEGLOBALFUEL_WORKSPACE_ID"],
            organization_id=os.environ["THEGLOBALFUEL_ORGANIZATION_ID"],
        )
        assets = await sdk.theglobalfuel.assets.list()
        contracts = await sdk.theglobalfuel.contracts.list()
        print(f"Fetched {len(assets.items)} assets and {len(contracts.items)} contracts")
    finally:
        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 Theglobalfuel domain bundle keeps its sub-entities
nested:

```python
await sdk.theglobalfuel.assets.list()
await sdk.theglobalfuel.production.list()
await sdk.theglobalfuel.reserves.list()
await sdk.theglobalfuel.contracts.list()
await sdk.theglobalfuel.shipments.list()
await sdk.theglobalfuel.inventory.list()
await sdk.theglobalfuel.emissions.list()
await sdk.theglobalfuel.compliance.list()
await sdk.theglobalfuel.system.health()
```

## Modules

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

## Configuration

```python
from theglobalfuel_sdk import TheglobalfuelSDK

sdk = TheglobalfuelSDK(
    workspace_endpoint="https://graphqlworkspaces.burdenoff.com/workspaces/graphql",
    global_endpoint="https://graphql.burdenoff.com/global/graphql",
    client_id=None,                         # optional OIDC client id
    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 burdenoff_sdk_libs.modules.auth.types import SignInInput

from theglobalfuel_sdk import (
    TheglobalfuelError,
    AuthenticationError,
    AuthorizationError,
    NetworkError,
    ValidationError,
    RateLimitError,
    DeviceCodeExpiredError,
    DeviceCodeDeniedError,
)

try:
    await sdk.auth.sign_in(SignInInput(username="user@example.com", password="wrong"))
except AuthenticationError:
    print("Invalid credentials")
except NetworkError:
    print("Could not reach the API")
except TheglobalfuelError 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/theglobalfuel-sdk-python/issues)
