Metadata-Version: 2.4
Name: Datasphere-Core
Version: 0.5.0
Summary: Shared application commands for SAP Datasphere automation
Project-URL: Homepage, https://github.com/peterschwps/SAP-Datasphere-CLI
Project-URL: Repository, https://github.com/peterschwps/SAP-Datasphere-CLI
Author: Peter Schwips
License: MIT License
        
        Copyright (c) 2025 Peter Schwips
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        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.
License-File: LICENSE.txt
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: filelock>=3.20.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: keyring>=25.6.0
Requires-Dist: platformdirs>=4.4.0
Requires-Dist: playwright>=1.54.0
Description-Content-Type: text/markdown

# Datasphere-Core

Shared, presentation-independent commands for SAP Datasphere automation.
Datasphere-Core powers
[Datasphere-CLI](https://github.com/peterschwps/SAP-Datasphere-CLI) and
[Datasphere-MCP](https://github.com/peterschwps/SAP-Datasphere-MCP).

## Installation

```bash
pip install datasphere-core
```

## Example

```python
import asyncio

from datasphere_core import CommandContext, DatasphereSession, SessionConfig
from datasphere_core.commands.task_chains import run_task_chain
from datasphere_core.models.task_chains import RunTaskChainRequest


async def main() -> None:
    config = SessionConfig(
        base_url="https://example.eu10.hcs.cloud.sap",
        authorization_url="https://example.authentication.sap.hana.ondemand.com/oauth/authorize",
        token_url="https://example.authentication.sap.hana.ondemand.com/oauth/token",
        client_id="client-id",
        client_secret="client-secret",
    )

    async with DatasphereSession(config) as session:
        await session.authenticate(interactive=True)
        result = await run_task_chain(
            CommandContext(client=session.client),
            RunTaskChainRequest(
                chain="TC_TEST_DEV",
                space="DEV",
                timeout_seconds=600,
            ),
        )
        print(result)


asyncio.run(main())
```

> [!NOTE]
> OAuth tokens are stored in the operating system credential store. Use an
> explicit interactive login before calling `authenticate(interactive=False)`
> from non-interactive applications.
