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.0.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.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: luna_sdk-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 1db3c0b33c7f35f5dfa7559b2f2066d64858d794aeac8748ccde49894813c2e3
MD5 8f5fec68542a22eb26e910677bb5bf92
BLAKE2b-256 16870c393fa82816fe7de1144d6038c76ca57be89691a344b220d08b2adf40b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for luna_sdk-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: luna_sdk-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e44a051570df39e94936df49844ff91e8631f429317d03ad1acf5145c642d7e6
MD5 2b4518a31f49a2651cfe7dd3ff9519ae
BLAKE2b-256 d951a1ac735e0892feb2de42a0531b42710910e5f7f0b7c6fb4a2a64064fcfe3

See more details on using hashes here.

Provenance

The following attestation bundles were made for luna_sdk-1.0.0-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