Metadata-Version: 2.4
Name: dmesh-sdk
Version: 0.1.1
Summary: dmesh SDK
Author: Joao Vicente
License-Expression: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: jsonschema
Requires-Dist: pydantic
Requires-Dist: pydantic-settings
Requires-Dist: pyyaml
Requires-Dist: requests
Description-Content-Type: text/markdown

# dmesh-sdk

![License](https://img.shields.io/badge/license-Apache%202.0-blue)
![Python Support](https://img.shields.io/badge/python-3.10%2B-blue)

A native asynchronous SDK for managing open data product and open contract standards. `dmesh-sdk` provides the core abstractions and persistence layers needed to implement the Open Data Mesh standard.

## 🚀 Key Features

*   **Async First**: Built from the ground up for high-performance asynchronous operations using `asyncio` and `psycopg3`.
*   **Idempotent Operations**: Safely publish and update data products and contracts.
*   **Validation**: Built-in JSON Schema validation for Data Product and Data Contract specifications.
*   **Pluggable Architecture**: Easily switch between storage backends (In-memory for testing, PostgreSQL for production).
*   **Factory-based Initialization**: Simplified setup for complex repository configurations.

## 📦 Installation

```bash
pip install dmesh-sdk
```

## 🛠️ Quick Start

```python
import asyncio
from dmesh.sdk import AsyncSDK, RepositoryFactory

async def main():
    # Initialize an In-Memory repository for testing
    factory = RepositoryFactory().create(db_type="memory")
    
    # Use the SDK as an asynchronous context manager
    async with AsyncSDK(factory) as sdk:
        # Register a data product (idempotent)
        spec = {
            "domain": "finance",
            "name": "ledger",
            "version": "v1.0.0"
        }
        dp = await sdk.put_data_product(spec)
        print(f"Registered Data Product ID: {dp['id']}")

if __name__ == "__main__":
    asyncio.run(main())
```

## 📖 Related Projects

*   **dmesh-cli**: Command-line interface for managing your data mesh.
*   **dmesh-api**: REST API (FastAPI based) server for data mesh orchestration.
*   **dmesh-viewer**: Web-based interface for data mesh visualization.

## 📄 License

This project is licensed under the Apache 2.0 License. See the [LICENSE](https://github.com/dmesh-zone/dmesh-core/blob/main/LICENSE) file for details.
