Installation#
Install labapi with the extras you need, then configure credentials with
.env or environment variables.
Python Version#
Supports Python 3.10 and newer.
Choose an Install Profile#
Choose the install target that includes the helpers you need:
Profile |
Install Target |
Use When |
|---|---|---|
Recommended local interactive |
|
You want |
Minimal |
|
You already manage environment variables or pass credentials directly, and you do not need optional helpers. |
Minimal + |
|
You want |
uv add "labapi[dotenv,builtin-auth]"
uv add labapi
uv add "labapi[dotenv]"
poetry add "labapi[dotenv,builtin-auth]"
poetry add labapi
poetry add "labapi[dotenv]"
pip install "labapi[dotenv,builtin-auth]"
pip install labapi
pip install "labapi[dotenv]"
Optional Extras#
labapi has two optional extras:
dotenvletsClientreadAPI_URL,ACCESS_KEYID, andACCESS_PWDfrom a local.envfile.builtin-authletsdefault_authenticate()auto-detect and open a local browser. Without it, you can still use terminal/manual auth or your own callback flow.
Configuration#
If you installed dotenv, create a local .env file:
API_URL="https://api.labarchives.com"
ACCESS_KEYID="your_access_key"
ACCESS_PWD="your_access_password"
If you did not install dotenv, set those values directly in your shell
before running your code:
export API_URL="https://api.labarchives.com"
export ACCESS_KEYID="your_access_key"
export ACCESS_PWD="your_access_password"
$env:API_URL="https://api.labarchives.com"
$env:ACCESS_KEYID="your_access_key"
$env:ACCESS_PWD="your_access_password"
set API_URL=https://api.labarchives.com
set ACCESS_KEYID=your_access_key
set ACCESS_PWD=your_access_password