Skip to main content

luaward — Python SDK

Client แบบ sync และ async สำหรับ Luaward Developer REST API /v3 พร้อม LuarmorCompat ต้องใช้ Python 3.10 ขึ้นไป

การติดตั้ง (Installation)

pip install luaward

Official Python SDK สำหรับ Luaward — รองรับทั้ง sync และ async โดยไม่ต้องติดตั้ง dependency เพิ่ม (async เรียก sync HTTP client ผ่าน asyncio.to_thread() และใช้ urllib มาตรฐาน ไม่มี dependency ภายนอก; ดูเอกสารเพิ่มเติมที่ luaward.com/docs และ github.com/luaward)

Credentials และ URL

ใช้ Developer API key lwa_live_… จาก Developer API ของ workspace ผ่าน argument api_key ไม่ใช่ token และไม่ใช่ personal token lwm_… ของ CLI/IDE/MCP ค่าเริ่มต้น base_url คือ https://api.luaward.com โดย client เติม /v3 เอง ID ของโปรเจกต์และสคริปต์เป็นค่าจริง 32 ตัวอักษรฐานสิบหกจาก dashboard/API เก็บ credentials ไว้ใน environment ฝั่งเซิร์ฟเวอร์

Sync client

import os
from luaward import LuawardClient, LuarmorCompat

lw = LuawardClient(
    api_key=os.environ["LUAWARD_API_KEY"],
    project_id=os.environ["LUAWARD_PROJECT_ID"],
)

created = lw.keys.create(
    discord_id="123456789012345678",
    key_days=30,
    note="Monthly access",
)
print("Generated key:", created["user_key"])
lw.keys.reset_hwid(created["user_key"])

queued = lw.scripts.upload(
    os.environ["LUAWARD_SCRIPT_ID"],
    'print("Hello from SDK")',
    preset="balanced",
)
print("Queued build:", queued["build_id"])

compat = LuarmorCompat(
    api_key=os.environ["LUAWARD_API_KEY"],
    project_id=os.environ["LUAWARD_PROJECT_ID"],
)
compat.reset_hwid(user_key=created["user_key"], force=True)

key_days เริ่มนับเมื่อใช้คีย์ครั้งแรก ส่วน auth_expire กำหนดเวลาหมดอายุเป็น Unix seconds และมีลำดับความสำคัญเหนือ key_days ค่าของ preset คือ fast, balanced หรือ max เมื่อ build ใหม่ Ready loader จะใช้ build นั้นอัตโนมัติหากไม่มีรุ่นใหม่กว่าถูกเลือกไว้

Async client

import os
from luaward import AsyncLuawardClient

lw = AsyncLuawardClient(
    api_key=os.environ["LUAWARD_API_KEY"],
    project_id=os.environ["LUAWARD_PROJECT_ID"],
)

async def on_redeem(discord_id: str):
    created = await lw.keys.create(discord_id=discord_id, key_days=30, note="Discord redeem")
    return created["user_key"]

Sync client มี keys, scripts และ stats ส่วน async client มี keys และ request() เท่านั้น ใช้ await lw.request(method, path, body) สำหรับ endpoint อื่น โดยเทียบ fields/scopes กับ REST reference ไม่มีการรับรองความเข้ากันได้กับ wrapper Luarmor ทุกตัว ต้องทดสอบ automation เดิมแยกก่อนย้าย

Retry HTTP 429/503 สูงสุด 3 ครั้งเป็นค่าเริ่มต้น ปรับผ่าน max_retries และ retry_base_delay ได้ มี typed errors ใน luaward.exceptions; รายละเอียดคำตอบ API อยู่ใน error.payload

Metadata

Release files for luaward 0.1.0

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

Source distribution (sdist)

Source distribution for luaward 0.1.0
File Size Uploaded Provenance Actions
luaward-0.1.0.tar.gz 10.8 kB Without provenance Details for luaward-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for luaward 0.1.0
File Interpreter ABI Platform Actions
luaward-0.1.0-py3-none-any.whl Python 3 none any Details for luaward-0.1.0-py3-none-any.whl

Total release size: 19.1 kB

Release files / luaward-0.1.0.tar.gz

Download URL luaward-0.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
403b3496b4662cc21c04ef2c7f89b86d63ec1855c1079bbf2d6f2ffbd21301f1
BLAKE2b-256 checksum
How to use checksums
277226131e25288fc8a0514708d0571704dab2892f09d81ca5b0e7813322192d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / luaward-0.1.0-py3-none-any.whl

Download URL luaward-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6f5cc0d3fb1c00cd1730ddb3d795f26b72fa115632b40b1b689b096f128b513
BLAKE2b-256 checksum
How to use checksums
cf356a3946af84f42526d80bb79cec03f9f1ad792a773604d2c8a70337677aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for luaward 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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