Project¶
-
class
moco_wrapper.models.
Project
(moco)¶ Class for handling projects.
-
archive
(project_id: int)¶ Archive a project.
Parameters: project_id (int) – Id of the project to archive Returns: The archived project
-
assigned
(active: bool = None, sort_by: str = None, sort_order: str = 'asc', page: int = 1)¶ Get list of all project currently assigned to the user.
Parameters: - active (bool) – Show only active or inacitve projects
- sort_by (str) – Sort by field
- sort_order (str) – asc or desc (default asc)
- page (int) – Page number (default 1)
Returns: List of project objects
-
create
(name: str, currency: str, leader_id: int, customer_id: int, finish_date: datetime.date = None, identifier: str = None, billing_address: str = None, billing_variant: moco_wrapper.models.project.ProjectBillingVariant = None, hourly_rate: float = None, budget: float = None, labels: list = None, custom_properties: dict = None, info: str = None, fixed_price: bool = False)¶ Create a new project.
Parameters: - name (str) – Name of the project
- currency (str) – Currency used by the project (e.g. EUR)
- leader_id (int) – User id of the project leader
- customer_id (int) – Company id of the customer
- finish_date (datetime.date, str) – Finish date
- identifier (str) – Project Identifier
- billing_address (str) – Billing adress the invoices go to
- billing_variant (
ProjectBillingVariant
, str) – Billing variant used - hourly_rate (float) – Hourly rate that will get billed
- budget (float) – Budget for the project
- labels (list) – Array of additional labels
- custom_properties (dict) – Custom values used by the project
- info (str) – Additional information
- fixed_price (bool) – If the project is a fixed price projects (default False)
Returns: The created project object
Note
The parameter
identifier
is required if number ranges are manual.Note
If you create a fixed_price project budget must also be set.
-
get
(project_id: int)¶ Get a single project.
Parameters: project_id (int) – Id of the project Returns: Project object
-
getlist
(include_archived: bool = None, include_company: bool = None, leader_id: int = None, company_id: int = None, created_from: datetime.date = None, created_to: datetime.date = None, updated_from: datetime.date = None, updated_to: datetime.date = None, tags: list = None, identifier: str = None, sort_by: str = None, sort_order: str = 'asc', page: int = 1)¶ Get a list of projects.
Parameters: - include_archived (bool) – Include archived projects
- include_company (bool) – Include the complete company object or just the company id
- leader_id (int) – User id of the project leader
- company_id (int) – Company id the projects are assigned to
- created_from (datetime.date, str) – Created start date
- created_to (datetime.date, str) – Created end date
- updated_from (datetime.date, str) – Updated start date
- updated_to (datetime.date, str) – Updated end date
- tags (list) – Array of tags
- identifier – Project identifer
- sort_by (str) – Field to sort the results by
- sort_order (str) – asc or desc (default asc)
- page (int) – Page number (default 1)
Returns: List of project objects
-
report
(project_id: int)¶ Retrieve a project report.
All costs are in the accounts main currency, it might differ from the budget and billable items.
Parameters: project_id (int) – Id of the project Returns: Report with the most important project business indicators
-
unarchive
(project_id: int)¶ Unarchive a project.
Parameters: project_id (int) – Id of the project to unarchive Returns: The unarchived project
-
update
(project_id: int, name: str = None, leader_id: int = None, customer_id: int = None, finish_date: datetime.date = None, identifier: str = None, billing_address: str = None, billing_variant: moco_wrapper.models.project.ProjectBillingVariant = None, hourly_rate: float = None, budget: float = None, labels: list = None, custom_properties: dict = None, info: str = None)¶ Update an existing project.
Parameters: - project_id (int) – Id of the project to update
- name (str) – Name of the project
- leader_id (int) – User id of the project leader
- customer_id (int) – Company id of the customer
- finish_date (datetime.date, str) – Finish date
- identifier (str) – Project Identifier
- billing_address (str) – Address the invoices go to
- billing_variant (
ProjectBillingVariant
, str) – Billing variant used - hourly_rate (float) – Hourly rate that will get billed
- budget (float) – Budget for the project
- labels (list) – Array of additional labels
- custom_properties (dict) – Custom values used by the project
- info (str) – Additional information
Returns: The updated project object
-
-
class
moco_wrapper.models.project.
ProjectBillingVariant
¶ Enumeration for allowed values of the
billing_variant
argument ofProject.create()
andProject.update()
.Example usage:
from moco_wrapper.models.project import ProjectBillingVariant from moco_wrapper import Moco m = Moco() new_project = m.Project.create( .. billing_variant = ProjectBillingVariant.USER )
-
PROJECT
= 'project'¶
-
TASK
= 'task'¶
-
USER
= 'user'¶
-