Skip to main content

edi-maas-sdk

MaaS Platform Python SDK — HTTP client for model and dataset management.

Install

pip install edi-maas-sdk

Quick Start

from edi_maas_sdk import DatasetCategory, DatasetFormat, DatasetSplit, EdiApi

api = EdiApi(endpoint="https://maas.example.com/maas-service", api_key="edik-...")

# List models
repos = api.list_repos("models")
for r in repos:
    print(r.name, r.status)

# Create a model (display_name required; name is auto-generated)
result = api.create_repo("models", display_name="My Model", description="A fine-tuned model")

# Create a dataset (display_name required, name auto-generated; optional enums)
result = api.create_repo(
    "datasets",
    display_name="My Dataset",
    dataset_category=DatasetCategory.TEXT_CORPUS,
    format=DatasetFormat.PARQUET,
    split=DatasetSplit.TRAIN,
    tags=["nlp"],
)

# List versions
refs = api.list_repo_refs("models", org_id="acme", name=result.name)
for ref in refs:
    print(ref.id, ref.version_name)

# Create a new named version (e.g. for a new release)
new_ref = api.create_version("models", org_id="acme", name=result.name, version="v2.0.0", message="add v2 artifacts")

# Upload files into a specific version (targets that version's S3 prefix)
api.upload_file("models", org_id="acme", name=result.name, file_path="./weights.bin", version="v2.0.0")
api.upload_folder("models", org_id="acme", name=result.name, local_dir="./artifacts", version="v2.0.0")

# Browse files
files = api.list_repo_tree("models", org_id="acme", name=result.name, version=refs[0].version_name, recursive=True)
for f in files:
    print(f.type, f.path, f.size)

# Download (returns presigned URL; optional expires in seconds, max 3600)
info = api.file_download("models", org_id="acme", name=result.name, version=refs[0].version_name, path="pytorch_model.bin", expires=1800)
print(info.url, info.expires_in)

# Upload (pre-signed S3 multipart direct upload, streamed part-by-part)
api.upload_file("models", org_id="acme", name=result.name, file_path="./weights.bin", on_progress=lambda rel, done, total: print(f"{rel}: {done}/{total}"))

# Upload a whole folder (filename = path relative to folder)
api.upload_folder("models", org_id="acme", name=result.name, local_dir="./artifacts", on_progress=print)

Command-line Interface

The maas console script wraps the SDK for scripting. All subcommands share --endpoint, --api-key (or MAAS_SDK_API_KEY), --org-id, --name, --repo-type.

# Create a new named version
maas create-version --org-id acme --name repo-01hxxxx --version v2.0.0 --message "v2 release"

# Upload into a specific version
maas upload-file --org-id acme --name repo-01hxxxx --repo-type models --file ./weights.bin --version v2.0.0
maas upload-folder --org-id acme --name repo-01hxxxx --repo-type models --dir ./artifacts --version v2.0.0

# Download a file from a specific version
maas download-file --org-id acme --name repo-01hxxxx --repo-type models --version v2.0.0 --path pytorch_model.bin --output ./pytorch_model.bin

create-version and download-file require --version; upload-file / upload-folder accept an optional --version (omitting it targets the default version). --no-progress disables the progress bar.

Configuration

Environment Variable Description Default
MAAS_ENDPOINT MaaS service base URL http://localhost:8000/maas-service
MAAS_SDK_API_KEY SDK API key (required)

API Reference

EdiApi(endpoint=None, api_key=None)

Create a client. Reads MAAS_ENDPOINT and MAAS_SDK_API_KEY from environment if not provided.

Methods

Method Description
create_repo(repo_type, display_name, model_category?, dataset_category?, format?, split?, tags?) Create a model or dataset (name is auto-generated)
create_version(repo_type, *, org_id, name, version, message?) Create a new named version (e.g. v2.0.0)
list_repos(repo_type, keyword?, page_no?, page_size?) List repos
list_repo_refs(repo_type, *, org_id, name) List versions
list_repo_tree(repo_type, *, org_id, name, version, path?, recursive?) Browse files
file_download(repo_type, *, org_id, name, version, path, expires?) Get presigned download URL (expires in seconds, max 3600)
upload_file(repo_type, *, org_id, name, file_path, relative_path?, version?, on_progress?) Upload a single file (presigned S3 multipart, streamed; optional progress callback on_progress(rel, done, total); version targets a specific version)
upload_folder(repo_type, *, org_id, name, local_dir, version?, on_progress?) Upload a whole folder (relative paths preserved; optional progress callback; version targets a specific version). ValueError if the directory is missing or empty

Enums

create_repo accepts typed enums for category / format / split fields. The server validates these and rejects unknown values with HTTP 422.

Enum Values
ModelCategory llm, embedding, image, vision, audio, rerank, video
DatasetCategory text_corpus, instruction_tuning, image_caption, image_generation, lora_training, object_detection, image_classification, image_segmentation, other
DatasetFormat parquet, jsonl, csv, arrow, image_folder, text_folder, custom
DatasetSplit train, validation, test, train+validation, all, custom

License

MIT

Release files for edi-maas-sdk 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edi-maas-sdk 0.1.5
File Size Uploaded
edi_maas_sdk-0.1.5.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for edi-maas-sdk 0.1.5
File Interpreter ABI Platform
edi_maas_sdk-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / edi_maas_sdk-0.1.5.tar.gz

Download URL edi_maas_sdk-0.1.5.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d46cb850dac8956f6d2a455ec8a165828f13eca645215a8b4a5643668110d29e
BLAKE2b-256 checksum
How to use checksums
d994bfb6cd62eb71b9b132d392a5bbde210e758b3940570ae32b1b2db65232a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.13

Release files / edi_maas_sdk-0.1.5-py3-none-any.whl

Download URL edi_maas_sdk-0.1.5-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16351a8b4f5b3bc4fe70af627a4511987e0fc11be0010651edcee6ea850f2728
BLAKE2b-256 checksum
How to use checksums
c0bdf25ed5d0dfa729249f33ea4d08b28c321463dba2972ee10ba22c5ab639e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.13

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page