Python client library for the dAIEDGE Middleware API
Project description
dAIEDGE Middleware Client
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daiedge_middleware_client-1.0.2.tar.gz.
File metadata
- Download URL: daiedge_middleware_client-1.0.2.tar.gz
- Upload date:
- Size: 43.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eddf0bc774ca72b3fef54e511ac022198a8b8055a305942f401d70971156fae
|
|
| MD5 |
57142553d3328ada9dbc4250945d417e
|
|
| BLAKE2b-256 |
8069ddd46e82ccf447efe69681c7218eef87756a00b19407c2aa5a71cf845769
|
File details
Details for the file daiedge_middleware_client-1.0.2-py3-none-any.whl.
File metadata
- Download URL: daiedge_middleware_client-1.0.2-py3-none-any.whl
- Upload date:
- Size: 23.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3ed483a4206305ce4f34662f934d665cf2fb1b862ec641348c6d4cd26fc2733
|
|
| MD5 |
8a334aa0413018ed05dc880ee9ecd47d
|
|
| BLAKE2b-256 |
e86ddb9334deafba02aee9ae4046541eae02b2acc3eb965bfd606f1e91ebe592
|