nucleus-python-client
nucleus-python-client copied to clipboard
[DE-6014] Add support for limited access keys
Linear issue: https://linear.app/scale-epd/issue/DE-6014
Note: This allows the api_key and limited_access_key to be used together as well (let me know if you think this shouldn't me an option)
Testing:
After updating tests to support limited access keys, all tests that passed before this change still pass via poetry run pytest -q -m "not integration"
Example usage with poetry:
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient(limited_access_key="<LIMITED_ACCESS_KEY>")
print([d.name for d in c.datasets])
PY
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient(api_key="<API_KEY>", limited_access_key="<LIMITED_ACCESS_KEY>")
print([d.name for d in c.datasets])
PY
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient(api_key="<API_KEY>")
print([d.name for d in c.datasets])
PY
poetry run python - <<'PY'
import nucleus
c = nucleus.NucleusClient()
print([d.name for d in c.datasets])
PY
# Output
nucleus.errors.NoAPIKey: You must provide credentials to NucleusClient: pass api_key or limited_access_key, or set NUCLEUS_API_KEY or NUCLEUS_LIMITED_ACCESS_KEY.
Updated Documentation: