3.1.1.1. nordigen_cli.apiclient package
3.1.1.1.1. Submodules
3.1.1.1.2. nordigen_cli.apiclient.authentication module
- class nordigen_cli.apiclient.authentication.RefreshableHeaderAuthentication(token: AccessToken = None, parameter: str = 'Authorization', scheme: str | None = 'Bearer', extra: dict[str, str] | None = None)[source]
Bases:
BaseAuthenticationMethod
- get_token() AccessToken [source]
- set_token(token: AccessToken)[source]
3.1.1.1.3. nordigen_cli.apiclient.base module
- class nordigen_cli.apiclient.base.ClientState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
- ACCESS_TOKEN_ACTIVE = 4
- ACCESS_TOKEN_INVALID = 5
a resource request failed with an invalid access token
- INITIAL = 1
- NO_TOKENS = 3
no tokens initially provided
- TOKENS_CACHED = 2
initial inspection provided both tokens with valid expiry
- TOKEN_PAIR_REQUEST_FAILED = 7
token pair request failed
- TOKEN_REFRESH_REQUEST_FAILED = 6
refresh token request failed
- class nordigen_cli.apiclient.base.NordigenClientBase(*, id=None, key=None, api=None, **kwargs)[source]
Bases:
object
- property access_token: AccessToken
- base_url: str = ''
- do_init: bool = True
- get_access_token() AccessToken [source]
- get_refresh_token() RefreshToken [source]
- r_client: ResourceClient = None
- refresh_callback: Callable = None
- property refresh_token: RefreshToken
- retrieve_callback: Callable = None
- set_access_token(token: AccessToken)[source]
- set_refresh_token(token: RefreshToken)[source]
- signon_callback: Callable = None
- state: ClientState = 1
- t_client: TokenClient = None
- class nordigen_cli.apiclient.base.ResourceClient(**kwargs)[source]
Bases:
APIClient
Nordigen API client implementing Oauth2 implement oauth2 token refresh flow states
- base_url: str = ''
- get_authentication_method() RefreshableHeaderAuthentication [source]
- class nordigen_cli.apiclient.base.TokenClient(**kwargs)[source]
Bases:
APIClient
- do_get_token_new(*args, **params) SpectacularJWTObtain [source]
- do_post_token_refresh(**params) AccessToken [source]
- get_tokens(*args, **kwargs) tuple[AccessToken, RefreshToken] [source]
- refresh_token: RefreshToken = None
- secret_id: str = None
- secret_key: str = None
3.1.1.1.4. nordigen_cli.apiclient.client module
- class nordigen_cli.apiclient.client.NordigenClient(*, id=None, key=None, api=None, **kwargs)[source]
Bases:
NordigenClientBase
- create_requisition(*, redirect: str, institution_id, agreement: UUID = None, reference: str = None, user_language='EN', ssn: str | None, account_selection: bool | None = False, redirect_immediate: bool | None = False) SpectacularRequisition [source]
- list_account_transactions(account_id: UUID) AccountTransactions [source]
- list_agreements(limit: int = 100, offset: int = 0) list[EndUserAgreement] [source]
- list_banks(code, /, **kwargs) list[Integration] [source]
- list_requisitions(limit: int = 100, offset: int = 0) list[Requisition] [source]
- show_agreement(agreement_id: UUID) EndUserAgreement [source]
- show_bank(bank_id, /, **kwargs) IntegrationRetrieve [source]
3.1.1.1.5. nordigen_cli.apiclient.endpoints module
- class nordigen_cli.apiclient.endpoints.BaseEndpoints[source]
Bases:
object
- account_balances = 'accounts/{id}/balances/'
- account_details = 'accounts/{id}/details/'
- account_metadata = 'accounts/{id}/'
- agreement = 'agreements/enduser/{id}/'
- agreement_accept = 'agreements/enduser/{agreement_id}/accept/'
- agreements = 'agreements/enduser/'
- bank = 'institutions/{id}/'
- banks = 'institutions/?country={code}'
- requisition = 'requisitions/{id}/'
- requisitions = 'requisitions/'
- token_new = 'token/new/'
- token_refresh = 'token/refresh/'
- transactions = 'accounts/{id}/transactions/'
- class nordigen_cli.apiclient.endpoints.Endpoints[source]
Bases:
object
- account_balances = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/accounts/{account_id}/balances/'
- account_details = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/accounts/{account_id}/details/'
- account_metadata = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/accounts/{account_id}/metadata/'
- agreement = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/agreements/enduser/{id}/'
- agreement_accept = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/agreements/enduser/{agreement_id}/accept/'
- agreements = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/agreements/enduser/'
- bank = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/institutions/{id}/'
- banks = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/institutions/?country={code}'
- requisition = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/requisitions/{id}/'
- requisitions = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/requisitions/'
- token_new = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/token/new/'
- token_refresh = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/token/refresh/'
- transactions = 'xxxhttps://bankaccountdata.gocardless.com/api/v2/accounts/{id}/transactions/'
3.1.1.1.6. nordigen_cli.apiclient.errors module
- exception nordigen_cli.apiclient.errors.AuthenticationFailedError(response: Response, **kwargs)[source]
Bases:
NordigenClientError
- exception nordigen_cli.apiclient.errors.InvalidTokenError(response: Response, **kwargs)[source]
Bases:
NordigenClientError
- exception nordigen_cli.apiclient.errors.NordigenClientError(response: Response, **kwargs)[source]
Bases:
ClientError
Client error which has fields for ErrorResponse objects
- Parameters:
response (Response) – Response object
message (str) – Error message
status_code (int) – HTTP status code
info (dict) – Raw data from response
Note
doesn’t seem to pass type though in any response
Example
This is an example of the error response from the Nordigen API:
{ "summary": "Authentication failed", "detail": "No active account found with the given credentials", "status_code": 401 "type": null }
- response: Response
- exception nordigen_cli.apiclient.errors.OtherAuthenticationError(response: Response, **kwargs)[source]
Bases:
NordigenClientError
- exception nordigen_cli.apiclient.errors.PageNotFoundError(response: Response, **kwargs)[source]
Bases:
NordigenClientError
- class nordigen_cli.apiclient.errors.SignonErrorHandler[source]
Bases:
ResourceErrorHandler
- exception nordigen_cli.apiclient.errors.TokenExpiredError(response: Response, **kwargs)[source]
Bases:
NordigenClientError