data_downloader.services.HyP3Service#
- class data_downloader.services.HyP3Service(username: str | None = None, password: str | None = None, prompt: bool = False, include_expired=False)#
Class to manage HyP3 user information and jobs
- __init__(username: str | None = None, password: str | None = None, prompt: bool = False, include_expired=False)#
Initialize the HyP3Service class
- Parameters:
username (str, optional) – Username and password for HyP3
password (str, optional) – Username and password for HyP3
prompt (bool, optional) – Prompt for the username and password in the terminal, by default False.
include_expired (bool, optional) – Include expired jobs, by default False
Methods
__init__([username, password, prompt, ...])Initialize the HyP3Service class
flush()Flush the jobs and the user's information
Flush the user's information
Flush the jobs
login([username, password, prompt])Login to HyP3.
Attributes
all jobs (not expired by default, set
include_expired=Trueto include expired jobs)user's information
- __init__(username: str | None = None, password: str | None = None, prompt: bool = False, include_expired=False)#
Initialize the HyP3Service class
- Parameters:
username (str, optional) – Username and password for HyP3
password (str, optional) – Username and password for HyP3
prompt (bool, optional) – Prompt for the username and password in the terminal, by default False.
include_expired (bool, optional) – Include expired jobs, by default False
- flush_jobs() None#
Flush the jobs
- flush_info() None#
Flush the user’s information
- flush() None#
Flush the jobs and the user’s information
- login(username: str | None = None, password: str | None = None, prompt: bool = False) None#
Login to HyP3. If neither username/password nor prompt is provided, it will attempts to use credentials from a
.netrcfile. If prompt is True, the username and password will be prompted in the terminal. Otherwise, the username and password must be provided.Note
This method will be called automatically when the class is initialized. However, you can change the user by calling this method again with the new username and password.
- Parameters:
username (str, optional) – Username and password for HyP3
password (str, optional) – Username and password for HyP3
prompt (bool, optional) – Prompt for the username and password in the terminal, by default False.
- property my_info: dict#
user’s information