Installation¶
lunaspace needs Python 3.10 or newer. Its one dependency is
httpx.
$ pip install lunaspace
With pandas, for the diagnostics, the trends and the residuals as data frames (Diagnostics and trends):
$ pip install 'lunaspace[pandas]'
Your key¶
Every request carries your organisation’s API key (lsk_...). Give it to the client in the
environment, so that it stays out of your code:
$ export LUNA_API_KEY=lsk_...
from lunaspace import Client
client = Client() # LUNA_API_KEY
print(client.me().name) # your organisation
or as an argument, Client(api_key="lsk_..."). The client never prints, logs or puts the key
in an error’s message.
Variable |
Default |
|
|---|---|---|
|
none |
Your organisation’s API key |
|
|
The API’s address |
Both can be given to Client(api_key=..., base_url=...) instead. A client holds a
connection pool: use it as a context manager (with Client() as client:) or call
client.close() when done.
Versions¶
The 0.x versions follow the client as it grows; 1.x will follow the API’s /v1. The
Changelog lists what each version brought. lunaspace is published under the
Apache License 2.0.