KaggleCredential
Credential for the Kaggle API.
The key is expected in the form "username:api_key".
Methods
apply(self) -> None
KaggleCredentialExport the stored Kaggle credentials to the environment.
verify(self, key: str) -> bool
KaggleCredentialValidate a Kaggle credential with the official kaggle library.
Parameters
- key : str
- Kaggle credential in the form
"username:api_key".
Returns
- bool
- True if the credential authenticates successfully.
auth(self, key: str) -> bool
BaseCredentialValidate and persist a key.
Parameters
- key : str
- The key to authenticate with.
Returns
- bool
- True on success.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_key(self) -> Optional[str]
BaseCredentialReturn the stored decrypted key, or None.
Returns
- Union[str, None]
- The decrypted key, or None if not authenticated.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
is_authenticated(self) -> bool
BaseCredentialReturn whether a verified key is stored.
Returns
- bool
- True if authenticated.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.