Account Class¶
Documentation of the Account class.
- class qmenta.client.Account(username, password, base_url='https://platform.qmenta.com', verify_certificates=True)¶
It represents your QMENTA account and implements the HTTP connection with the server. Once it is instantiated it will act as an identifier used by the rest of objects.
- Parameters
username (str) – Username on the platform. To get one go to https://platform.qmenta.com
password (str) – The password assigned to the username.
base_url (str) – The base url of the platform.
verify_certificates (bool) – verify SSL certificates?
- auth¶
The Auth object used for communication with the platform
- Type
qmenta.core.platform.Auth
- add_project(project_abbreviation, project_name, description='', users=[], from_date='', to_date='')¶
Add a new project to the user account.
- Parameters
project_abbreviation (str) – Abbreviation of the project name.
project_name (str) – Project name.
description (str) – Description of the project.
users (list[str]) – List of users to which this project is available.
from_date (str) – Date of beginning of the project.
to_date (str) – Date of ending of the project.
- Returns
True if project was correctly added, False otherwise
- Return type
bool
- get_project(project_id)¶
Retrieve a project instance, given its id, which can be obtained checking account.projects.
- Parameters
project_id (int or str) – ID of the project to retrieve, either the numeric ID or the name
- Returns
A project object representing the desired project
- Return type
- login()¶
Login to the platform.
- Raises
qmenta.core.platform.ConnectionError – When the connection to the platform fails.
qmenta.core.platform.InvalidLoginError – When invalid credentials are provided.
- logout()¶
Logout from the platform.
- Raises
qmenta.core.errors.PlatformError – When the logout was not successful
- property projects¶
List all the projects available to the current user.
- Returns
List of project identifiers (strings)
- Return type
list[str]