Skip to main content

Official Python SDK for the Eclipse Softworks Platform API

Project description

luna-sdk

Official Python SDK for the Eclipse Softworks Platform API.

Installation

pip install luna-sdk

Quick Start

import asyncio
from luna import LunaClient

async def main():
    # API Key authentication
    async with LunaClient(api_key="lk_live_xxxx") as client:
        # List users
        users = await client.users.list(limit=10)
        
        # Get a specific user
        user = await client.users.get("usr_123")
        
        # Create a new user
        from luna import UserCreate
        new_user = await client.users.create(
            UserCreate(email="john@example.com", name="John Doe")
        )

asyncio.run(main())

Authentication

API Key

client = LunaClient(api_key="lk_live_xxxx")

OAuth Token

async def save_tokens(tokens):
    # Save tokens to database
    pass

client = LunaClient(
    access_token=session.access_token,
    refresh_token=session.refresh_token,
    on_token_refresh=save_tokens,
)

Error Handling

from luna import LunaClient, NotFoundError, RateLimitError

try:
    await client.users.get("usr_nonexistent")
except NotFoundError as e:
    print(f"User not found: {e.message}")
except RateLimitError as e:
    print(f"Rate limited, retry after: {e.retry_after}")

Configuration

client = LunaClient(
    api_key="lk_live_xxxx",
    base_url="https://api.staging.eclipse.dev",
    timeout=60.0,
    max_retries=5,
    log_level="debug",
)

License

MIT © Eclipse Softworks

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

luna_sdk-1.0.1.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

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

luna_sdk-1.0.1-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file luna_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: luna_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for luna_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8f72ae3bb72f6c39661e290483ba0d9e87be31f48a93b39be40ae2988ee58155
MD5 368b2f8baf1e06b6306cedbd87d5a6ab
BLAKE2b-256 1da24157c8570bfceff5cce904126f193dec0f5f96cf438c9fd328f7ae134f9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for luna_sdk-1.0.1.tar.gz:

Publisher: release.yml on Eclipse-Softworks/Luna-SDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file luna_sdk-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: luna_sdk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for luna_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca368d4a308e0f14e7a0601797e5cadcb5ca45882b8db48e0ab50e1341b9ba8e
MD5 7894c4642d320baaa5b1622d7fa3997f
BLAKE2b-256 553ca307e1b9bdae18d7efd3841c7e1c67a171b6304bce161fef0a2b5f299637

See more details on using hashes here.

Provenance

The following attestation bundles were made for luna_sdk-1.0.1-py3-none-any.whl:

Publisher: release.yml on Eclipse-Softworks/Luna-SDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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