Skip to main content
It needs Python 3.11 or newer, has no dependencies, and ships type hints (py.typed). The package is getlurk and so is the import.

Send an event

Every operation in the API is a method named after it: lurk.rules.list(), lurk.units.get(id="beans"), lurk.users.get(id="maya@example.com"). Input is a dict or keywords: lurk.events.send(event="checkin.scanned", user="maya@example.com"). The types of inputs and answers are in getlurk.types, and your editor completes them.

Configure

Per call, pass options=RequestOptions(...):

Errors

A LurkError has status, code, param, request_id, doc_url, next_step and, for rate_limited, retry_after_seconds. Be ready for a code you have not seen: Lurk adds codes, fields and event types over time and never removes one inside a version (versioning).

Pages

More.

asyncio

AsyncLurk takes the same arguments and has the same methods, awaited.
Calls run on a worker thread, so they never block your event loop. Retries, idempotency keys and errors are the same as in the synchronous client.

Webhooks

Pass the raw body (bytes or text), not parsed JSON. The whole page.

Use another HTTP library

Lurk(transport=...) replaces the HTTP call: a proxy, requests, httpx, or a test double. Testing your code has an example.