ApiConfig
ApiConfig gathers the parameters needed to reach the Legifrance API. It is
consumed by LegifranceClient.
Fields
Section titled “Fields”| Field | Type | Default | Role |
|---|---|---|---|
client_id | str | — | PISTE identifier (required) |
client_secret | str | — | PISTE secret (required) |
token_url | str | PISTE prod | OAuth endpoint |
api_url | str | Legifrance prod | REST base URL |
connect_timeout | float | 3.05 | connect timeout (s) |
read_timeout | float | 27.0 | read timeout (s) |
Build a config
Section titled “Build a config”from pylegifrance.config import ApiConfig
# Manualconfig = ApiConfig(client_id="...", client_secret="...")
# From the environment (LEGIFRANCE_CLIENT_ID / _SECRET)config = ApiConfig.from_env()from_env() loads .env via python-dotenv; see
/en/operations/configure-api-credentials.
See also
Section titled “See also”/en/concepts/piste-oauth— whytoken_urlandapi_urlare distinct./en/references/config— signatures.