Zededa EdgeAI SDK - CLI and Python library for authentication and MLflow integration
Project description
Zededa EdgeAI SDK
The Zededa EdgeAI SDK provides both a pluggable command-line interface and a Python library for authenticating with the Zededa EdgeAI backend and preparing ML tooling environments.
Highlights
- 🧩 Modular command registry – each CLI sub-command lives in its own module under
edgeai_sdk.commands, making it easy to add new commands such ascatalogormodelwithout touching existing code. - 🧠 Typed service layer – shared HTTP, authentication, catalog, and storage logic is encapsulated under
edgeai_sdk.services, so workflows reuse the same battle-tested primitives. - 🔐 Secure OAuth login – browser-based authentication with automatic callback port discovery and detailed debug logging when needed.
- ⚙️ Environment bootstrap – exports MLflow and MinIO credentials into your shell and keeps helpers available for Python embedding.
Installation
pip install zededa-edgeai-sdk
To work from source:
git clone https://github.com/zededa/edgeai-sdk.git
cd edgeai-sdk
pip install -e .
CLI Usage
Every action is exposed as a sub-command. The current release ships the login, catalog, and set-catalog-context commands; future commands (for models, etc.) follow the same structure.
# Interactive OAuth login with optional catalog selection
zededa-edgeai login
# Login for a specific catalog using the default backend
zededa-edgeai login --catalog development
# Non-interactive login with credentials
zededa-edgeai login --email user@example.com --prompt-password
# Override backend URL and enable debug logging
EDGEAI_SERVICE_URL=https://custom.backend.local \
zededa-edgeai login --debug
After a successful login the CLI launches a child shell with the relevant environment variables applied. Exit that shell to return to your previous context.
Catalog Management
List available catalogs and switch between catalogs with an authenticated shell session:
# List all available catalogs
zededa-edgeai catalog --list
# Switch to a catalog and launch authenticated shell (recommended)
zededa-edgeai set-catalog-context development
# List catalogs with custom backend URL and debug logging
EDGEAI_SERVICE_URL=https://custom.backend.local \
zededa-edgeai catalog --list --debug
# Switch to catalog with debug logging
zededa-edgeai set-catalog-context production --debug
# Override service URL for one-time use
zededa-edgeai set-catalog-context staging --service-url https://staging.backend.com
The catalog list shows all catalogs you have access to, highlighting your current catalog. The set-catalog-context command switches to a catalog and launches an authenticated shell session with all required environment variables set, similar to the login command.
Available Options
Login Command
zededa-edgeai login [-h]
[--catalog CATALOG]
[--email EMAIL]
[--password PASSWORD]
[--prompt-password]
[--service-url SERVICE_URL]
[--debug]
Catalog Listing Command
zededa-edgeai catalog [-h]
[--list]
[--service-url SERVICE_URL]
[--debug]
Set Catalog Context Command
zededa-edgeai set-catalog-context [-h]
catalog
[--service-url SERVICE_URL]
[--debug]
Python Usage
Use the high-level client, the module helpers, or the command workflow directly:
Authentication
from edgeai_sdk.client import ZededaEdgeAIClient
client = ZededaEdgeAIClient()
creds = client.login(catalog_id="development")
print(creds["environment"]["MLFLOW_TRACKING_URI"])
Catalog Management
from edgeai_sdk.client import ZededaEdgeAIClient
# Using the client
client = ZededaEdgeAIClient()
# List available catalogs (prints formatted output by default)
client.list_catalogs()
# Output:
# Available Catalogs:
# ==================
# 1. demo1
# 2. demo2 (current)
# 3. development
# 4. production
# 5. staging
#
# Total: 5 catalogs
# Current catalog: demo2
# User: alice@company.com
# Get catalog data as dictionary (formatted=False)
catalogs = client.list_catalogs(formatted=False)
print(f"Available catalogs: {catalogs['available_catalogs']}")
# Switch to a catalog
creds = client.switch_catalog("production")
# Or using the module-level convenience functions
from edgeai_sdk import list_catalogs, switch_catalog
# List catalogs (formatted output)
list_catalogs()
# Get catalog data as dictionary
catalogs = list_catalogs(formatted=False)
# Switch catalog
creds = switch_catalog("production")
Direct Command Usage
Call the command workflows directly if you need finer-grained control:
from edgeai_sdk.commands.login import execute_login
from edgeai_sdk.commands.catalogs import execute_catalog_switch, execute_catalog_list
# Login
credentials = execute_login("development", debug=True)
# List catalogs
catalog_info = execute_catalog_list(debug=True)
# Switch catalogs (updates environment variables only)
credentials = execute_catalog_switch("production", debug=True)
Environment variables can be cleared programmatically via edgeai_sdk.client.logout() or edgeai_sdk.environment.clear_environment().
Architecture Overview
edgeai_sdk/
├── commands/ # CLI sub-command modules
│ ├── login.py # CLI handler + reusable login workflow helper
│ ├── catalogs.py # CLI handler + catalog listing workflow
│ └── set_catalog_context.py # CLI handler for catalog switching with shell launch
├── services/ # Low-level backend interactions
│ ├── http.py # Debug-aware HTTP client built on requests
│ ├── auth.py # OAuth browser flow and callback server
│ ├── catalogs.py # Catalog discovery and token scoping helpers
│ └── storage.py # MinIO credential retrieval
├── environment.py # Environment application/sanitisation helpers
├── client.py # Public high-level Python API
└── edgeai_sdk.py # Service coordination facade
Adding a new command means:
- Create
edgeai_sdk/commands/<command>.pywith aCommandSpecregistration function. - Implement the workflow using the shared services.
- Optionally expose convenient helpers from
client.pyor__init__.py.
The CLI automatically discovers commands from the registry.
Environment Variables
The login workflow applies the following variables to the current process and any spawned shells:
ZEDEDA_CURRENT_CATALOGZEDEDA_ACCESS_TOKENMLFLOW_TRACKING_TOKENAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYMLFLOW_S3_ENDPOINT_URLMLFLOW_TRACKING_URIMINIO_BUCKETZEDEDA_BACKEND_URL
Use edgeai_sdk.environment.APPLIED_ENVIRONMENT_KEYS for the authoritative list.
Development
# Run unit tests (creates/uses the local virtual environment)
./.venv/bin/python -m pytest
# Lint or format as needed
ruff check
black edgeai_sdk tests
All new features should include a matching command module and, when backend access is required, a focused service module.
Troubleshooting
- Pass
--debugto log all HTTP requests/responses with sensitive fields masked. - If the browser doesn't open automatically, copy the printed URL into a browser window manually.
- To retry a failed OAuth flow, simply rerun the command; a fresh callback port is selected automatically.
Support
- File an issue at github.com/zededa/edgeai-sdk
- Email support@zededa.com
Project details
Release history Release notifications | RSS feed
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 zededa_edgeai_sdk-1.0.3.tar.gz.
File metadata
- Download URL: zededa_edgeai_sdk-1.0.3.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a61a1b91dbcdce2a7d737df8c654d0b85959c462bcd7cf653d8b54d5e2ad9086
|
|
| MD5 |
9164de2ee69c239d54ce5e35c9f70feb
|
|
| BLAKE2b-256 |
2e2a6703306cdefcb32130f0da38095e9538a3e773e06483cac019f89c8a8b9f
|
File details
Details for the file zededa_edgeai_sdk-1.0.3-py3-none-any.whl.
File metadata
- Download URL: zededa_edgeai_sdk-1.0.3-py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d91fcc97825d0c9257e3545eeb213591bbc91209019933d6c18408430bb80d60
|
|
| MD5 |
872285b3e01bf96a9dead7746a5a09fe
|
|
| BLAKE2b-256 |
6b865c90592ef762a9b09f88a9674a24ba274e0dca61b54e28f971d3fda1f5ce
|