Skip to main content

Python client library for the dAIEDGE Middleware API

Project description

dAIEDGE Middleware Client

Python License

Python client library for the dAIEDGE Middleware API.

About

The dAIEDGE Middleware is a core component of the dAIEDGE Network of Excellence, designed to be a versatile bridge layer that provides communication, integration, and orchestration capabilities in complex, distributed edge AI environments.

This package provides a Python client for interacting with the dAIEDGE Middleware API, which offers functionalities for:

  • Authentication & User Management - Secure login, logout, and user registration
  • Identity & DID Management - Decentralized Identifiers (DID) management
  • Verifiable Credentials - VC issuance, verification, and presentations
  • Role-Based Access Control - Fine-grained access control policies
  • Resource Registration - Hardware, AI models, datasets, and benchmarks
  • Marketplace - Resource trading and listing
  • Token Management - Token minting and balance queries
  • Licensing - License request and validation
  • Reward System - Manual and automatic reward distribution

Requirements

  • Python 3.10+

Installation

pip install daiedge-middleware-client

Quick Start

The default API host is already configured to https://middleware-daiedge.bisite.usal.es/api/v1.

import asyncio
import daiedge_middleware_client
from daiedge_middleware_client import ApiClient, AuthApi
from daiedge_middleware_client.models import LoginRequest
from daiedge_middleware_client.exceptions import ApiException

async def main():
    # Use default configuration (no need to set host)
    async with ApiClient() as api_client:
        # Create an instance of the Auth API
        auth_api = AuthApi(api_client)
        
        # Login with username and password
        login_request = LoginRequest(
            username="your_username",
            password="your_password"
        )
        
        try:
            response = await auth_api.auth_login_post(login_request)
            print(f"Login successful! Session ID: {response.session_id}")
        except ApiException as e:
            print(f"Login failed: {e}")

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

Using Session Authentication

After logging in, use the session ID for subsequent API calls by setting it in the default headers:

import asyncio
import daiedge_middleware_client
from daiedge_middleware_client import ApiClient, AuthApi, IdentityApi
from daiedge_middleware_client.models import LoginRequest

async def main():
    async with ApiClient() as api_client:
        # Login first
        auth_api = AuthApi(api_client)
        login_request = LoginRequest(username="user", password="pass")
        login_response = await auth_api.auth_login_post(login_request)
        
        # Set session ID for authenticated requests
        api_client.default_headers["x-session-id"] = login_response.session_id
        
        # Now use other APIs with authentication
        identity_api = IdentityApi(api_client)
        identities = await identity_api.identities_get()
        print(f"Your identities: {identities}")

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

Custom API Host

If you need to use a different API endpoint:

import daiedge_middleware_client
from daiedge_middleware_client import Configuration

config = Configuration(
    host="https://your-custom-api.example.com/api/v1"
)
async with ApiClient(config) as api_client:
    # ...

Available API Modules

Module Description
AccessControlApi Access control and permissions
AuthApi Authentication (login, logout, signup)
IdentityApi DID and identity management
LicenseApi License management
MarketplaceApi Resource marketplace
PolicyApi Policy management
RegisterAiModelApi AI model registration
RegisterBenchmarkApi Benchmark registration
RegisterDatasetApi Dataset registration
RegisterHardwareApi Hardware registration
RewardManagerApi Reward system
RoleManagementApi Role management
SystemPauseApi System pause/control
TokensApi Token operations
UsersApi User management
VcApi Verifiable Credentials
WalletApi Wallet operations

Documentation

Development

Install development dependencies:

pip install -e ".[dev]"
# or with uv
uv sync --all-extras --dev

Run tests:

pytest

License

Proprietary - All rights reserved.

Author

BISITE Research group bisite@usal.es

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daiedge_middleware_client-1.0.3.tar.gz (98.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

daiedge_middleware_client-1.0.3-py3-none-any.whl (251.0 kB view details)

Uploaded Python 3

File details

Details for the file daiedge_middleware_client-1.0.3.tar.gz.

File metadata

  • Download URL: daiedge_middleware_client-1.0.3.tar.gz
  • Upload date:
  • Size: 98.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for daiedge_middleware_client-1.0.3.tar.gz
Algorithm Hash digest
SHA256 7eafe9cd9dc0e84be42a467d5a89c06cd257b3b5c2d52d8004dcbed06d80c595
MD5 712d50e9980ac31ec63cf7fc2ccd2be4
BLAKE2b-256 aba132be9689a416ee864ae4e0dc42fc829cec470f7df334c6a2fb21137f589c

See more details on using hashes here.

File details

Details for the file daiedge_middleware_client-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: daiedge_middleware_client-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 251.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for daiedge_middleware_client-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f29429b3e05c77f65cbcd669cf6a76896e74dbd0de610adb56be47e9205a522
MD5 7b799bf555fb8e54f86f656d132bf478
BLAKE2b-256 ac6135a65eb1853f54504b307467175f3af54e97164a7969be9ec78c2d8814b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page