Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AMAP ML SkillClaw build object store

From Leeroopedia
Knowledge Sources
Domains Object_Storage, Infrastructure
Last Updated 2026-10-22 00:00 GMT

Overview

Concrete tool for constructing backend-agnostic object store instances (local filesystem, S3, OSS) from configuration, provided by the SkillClaw client package.

Description

The build_object_store factory function creates a storage backend instance based on the `backend` parameter. It returns a LocalObjectStore (filesystem), S3ObjectStore (via boto3), or OSSObjectStore (via oss2), all implementing the same interface: `put_object`, `get_object`, `delete_object`, `iter_objects`. This abstraction lets SkillHub and EvolveServer work with any storage backend without knowing the concrete implementation.

Usage

Import and use when you need to:

  • Create a storage backend from configuration
  • Understand the storage abstraction layer
  • Build custom storage backends

Code Reference

Source Location

  • Repository: SkillClaw
  • File: `skillclaw/object_store.py:L225-264`

Signature

def build_object_store(
    backend: str | None,
    endpoint: str,
    bucket: str,
    access_key_id: str,
    secret_access_key: str,
    region: str = "",
    session_token: str = "",
    local_root: str = "",
) -> ObjectStore:
    """Create an object store instance for the given backend.

    Backends: "local" (filesystem), "s3" (boto3), "oss" (oss2).
    Returns: LocalObjectStore | S3ObjectStore | OSSObjectStore.
    """

Import

from skillclaw.object_store import build_object_store

I/O Contract

Inputs

Name Type Required Description
backend None Yes /// "local", "s3", "oss"
endpoint str No /// API endpoint (S3/OSS)
bucket str No /// Bucket name (S3/OSS) or root dir (local)
access_key_id str No /// Access key (S3/OSS)
secret_access_key str No /// Secret key (S3/OSS)
region str No /// Region (S3/OSS)
local_root str No /// Local filesystem root (local backend)

Outputs

Name Type Description
Returns ObjectStore /// Unified storage backend instance

Usage Examples

Local Storage

from skillclaw.object_store import build_object_store

store = build_object_store(
    backend="local",
    endpoint="",
    bucket="",
    access_key_id="",
    secret_access_key="",
    local_root="/tmp/skillclaw_storage",
)
store.put_object("test/file.txt", b"hello")
data = store.get_object("test/file.txt").read()  # b"hello"

S3 Storage

store = build_object_store(
    backend="s3",
    endpoint="",
    bucket="skillclaw-shared",
    access_key_id="AKIA...",
    secret_access_key="...",
    region="us-east-1",
)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment