Project Management
Usage
Fetch projects, time records, and expense records:
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
projects = factorialhr.ProjectEndpoint(api)
response = await projects.get(params={"page": 1})
for proj in response.data():
print(proj.name, proj.status)
time_records = factorialhr.TimeRecordEndpoint(api)
records = await time_records.get(params={"limit": 20})
for r in records.data():
print(r.employee_id, r.date, r.seconds)
expenses = factorialhr.ExpenseRecordEndpoint(api)
for e in (await expenses.all()).data():
print(e.amount, e.project_id)
asyncio.run(main())
Enums
Models and endpoints
- class factorialhr.ExpenseRecord(*, id: int, project_worker_id: int, expense_id: int, subproject_id: int | None = None, original_amount_currency: str | None = None, original_amount_cents: int | None = None, legal_entity_amount_currency: str | None = None, legal_entity_amount_cents: str | None = None, effective_on: date | None = None, exchange_rate: int | None = None, status: str | None = None)[source]
Model for project_management_expense_record.
- effective_on: date | None
Effective date
- exchange_rate: int | None
Exchange rate
- expense_id: int
Expense ID
- id: int
Expense record ID
- legal_entity_amount_cents: str | None
Legal entity amount in cents
- legal_entity_amount_currency: str | None
Legal entity amount currency
- original_amount_cents: int | None
Original amount in cents
- original_amount_currency: str | None
Original amount currency
- project_worker_id: int
Project worker ID
- status: str | None
Expense record status
- subproject_id: int | None
Subproject ID
- class factorialhr.ExpenseRecordEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[ExpenseRecord][source]
Get all expense records.
Official documentation: project_management/expense_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) ExpenseRecord[source]
Create a new expense record.
Official documentation: project_management/expense_records
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(expense_id: int | str, **kwargs) None[source]
Delete an expense record.
Official documentation: project_management/expense_records
- Parameters:
expense_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
None.
- Return type:
None
- async get(**kwargs) MetaApiResponse[ExpenseRecord][source]
Get expense records with pagination metadata.
Official documentation: project_management/expense_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(expense_id: int | str, **kwargs) ExpenseRecord[source]
Get a specific expense record by ID.
Official documentation: project_management/expense_records
- Parameters:
expense_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(expense_id: int | str, data: Mapping[str, Any], **kwargs) ExpenseRecord[source]
Update an expense record.
Official documentation: project_management/expense_records
- Parameters:
expense_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.ExportableExpense(*, date: date | None = None, project_name: str | None = None, subproject_name: str | None = None, employee_name: str, preferred_name: str | None = None, amount: str | None = None, currency: str | None = None, expense_category: str | None = None, expense_subcategory: str | None = None, expense_status: str | None = None, expense_link: str | None = None)[source]
Model for project_management_exportable_expense.
- amount: str | None
Expense amount
- currency: str | None
Currency
- date: date | None
Expense date
- employee_name: str
Employee name
- expense_category: str | None
Expense category
- expense_link: str | None
Link to expense details
- expense_status: str | None
Expense status
- expense_subcategory: str | None
Expense subcategory
- preferred_name: str | None
Employee preferred name
- project_name: str | None
Project name
- subproject_name: str | None
Subproject name
- class factorialhr.ExportableExpenseEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[ExportableExpense][source]
Get all exportable expenses.
Official documentation: project_management/exportable_expenses
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) ExportableExpense[source]
Create a new exportable expense.
Official documentation: project_management/exportable_expenses
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(expense_id: int | str, **kwargs) None[source]
Delete an exportable expense.
Official documentation: project_management/exportable_expenses
- Parameters:
expense_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
None.
- Return type:
None
- async get(**kwargs) MetaApiResponse[ExportableExpense][source]
Get exportable expenses with pagination metadata.
Official documentation: project_management/exportable_expenses
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(expense_id: int | str, **kwargs) ExportableExpense[source]
Get a specific exportable expense by ID.
Official documentation: project_management/exportable_expenses
- Parameters:
expense_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(expense_id: int | str, data: Mapping[str, Any], **kwargs) ExportableExpense[source]
Update an exportable expense.
Official documentation: project_management/exportable_expenses
- Parameters:
expense_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.ExportableProject(*, id: str, date: date | None = None, project_name: str, project_code: str | None = None, project_start_date: date | None = None, project_due_date: date | None = None, project_status: str, subproject_name: str | None = None, employee_name: str | None = None, employee_id: int | None = None, inputed_time: float)[source]
Model for project_management_exportable_project.
- date: date | None
Project date
- employee_id: int | None
Employee ID
- employee_name: str | None
Employee name
- id: str
Project ID
- inputed_time: float
Inputted time (API returns string but can be float)
- project_code: str | None
Project code
- project_due_date: date | None
Project due date
- project_name: str
Project name
- project_start_date: date | None
Project start date
- project_status: str
Project status
- subproject_name: str | None
Subproject name
- class factorialhr.ExportableProjectEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[ExportableProject][source]
Get all exportable projects.
Official documentation: project_management/exportable_projects
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) ExportableProject[source]
Create a new exportable project.
Official documentation: project_management/exportable_projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(project_id: int | str, **kwargs) None[source]
Delete an exportable project.
Official documentation: project_management/exportable_projects
- Parameters:
project_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
None.
- Return type:
None
- async get(**kwargs) MetaApiResponse[ExportableProject][source]
Get exportable projects with pagination metadata.
Official documentation: project_management/exportable_projects
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(project_id: int | str, **kwargs) ExportableProject[source]
Get a specific exportable project by ID.
Official documentation: project_management/exportable_projects
- Parameters:
project_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(project_id: int | str, data: Mapping[str, Any], **kwargs) ExportableProject[source]
Update an exportable project.
Official documentation: project_management/exportable_projects
- Parameters:
project_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.FlexibleTimeRecord(*, id: int, date: date, imputed_minutes: int, project_worker_id: int, subproject_id: int | None = None)[source]
Model for project_management_flexible_time_record.
- date: date
Record date
- id: int
Flexible time record ID
- imputed_minutes: int
Imputed minutes
- project_worker_id: int
Project worker ID
- subproject_id: int | None
Subproject ID
- class factorialhr.FlexibleTimeRecordComment(*, id: int, content: str, flexible_time_record_id: int)[source]
Model for project_management_flexible_time_record_comment.
- content: str
Comment content
- flexible_time_record_id: int
Flexible time record ID
- id: int
Comment ID
- class factorialhr.FlexibleTimeRecordCommentEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[FlexibleTimeRecordComment][source]
Get all flexible time record comments.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) FlexibleTimeRecordComment[source]
Create a new flexible time record comment.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(comment_id: int | str, **kwargs) FlexibleTimeRecordComment[source]
Delete a flexible time record comment.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
comment_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async delete_by_flexible_time_record(data: Mapping[str, Any], **kwargs) FlexibleTimeRecordComment[source]
Delete a flexible time record comment by flexible time record ID.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async get(**kwargs) MetaApiResponse[FlexibleTimeRecordComment][source]
Get flexible time record comments with pagination metadata.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(comment_id: int | str, **kwargs) FlexibleTimeRecordComment[source]
Get a specific flexible time record comment by ID.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
comment_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(comment_id: int | str, data: Mapping[str, Any], **kwargs) FlexibleTimeRecordComment[source]
Update a flexible time record comment.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
comment_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- async update_by_flexible_time_record(data: Mapping[str, Any], **kwargs) FlexibleTimeRecordComment[source]
Update a flexible time record comment by flexible time record ID.
Official documentation: project_management/flexible_time_record_comments
- Parameters:
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- class factorialhr.FlexibleTimeRecordEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[FlexibleTimeRecord][source]
Get all flexible time records.
Official documentation: project_management/flexible_time_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) FlexibleTimeRecord[source]
Create a new flexible time record.
Official documentation: project_management/flexible_time_records
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(record_id: int | str, **kwargs) FlexibleTimeRecord[source]
Delete a flexible time record.
Official documentation: project_management/flexible_time_records
- Parameters:
record_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[FlexibleTimeRecord][source]
Get flexible time records with pagination metadata.
Official documentation: project_management/flexible_time_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(record_id: int | str, **kwargs) FlexibleTimeRecord[source]
Get a specific flexible time record by ID.
Official documentation: project_management/flexible_time_records
- Parameters:
record_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(record_id: int | str, data: Mapping[str, Any], **kwargs) FlexibleTimeRecord[source]
Update a flexible time record.
Official documentation: project_management/flexible_time_records
- Parameters:
record_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.PlannedRecord(*, id: int, daily_minutes: int, start_date: date, end_date: date, project_worker_id: int, week_days: Sequence[int], subproject_id: int | None = None)[source]
Model for project_management_planned_record.
- daily_minutes: int
The daily minutes of the planned record
- end_date: date
The end date of the planned record
- id: int
The id of the planned record
- project_worker_id: int
The project worker id of the planned record
- start_date: date
The start date of the planned record
- subproject_id: int | None
The subproject id of the planned record
- week_days: Sequence[int]
The week days of the planned record, start in Sunday 0 and end in Saturday 6
- class factorialhr.PlannedRecordsEndpoint(api: ApiClient)[source]
Endpoint for project_management/planned_records operations.
- async all(**kwargs) ListApiResponse[PlannedRecord][source]
Get all planned records.
Official documentation: project_management/planned_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async bulk_create(data: Mapping[str, Any], **kwargs) Sequence[PlannedRecord][source]
Bulk create planned records.
Official documentation: project_management/planned_records
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
Sequence[PlannedRecord]
- async delete(planned_record_id: int | str, **kwargs) PlannedRecord[source]
Delete a planned record.
Official documentation: project_management/planned_records
- Parameters:
planned_record_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[PlannedRecord][source]
Get planned records with pagination metadata.
Official documentation: project_management/planned_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(planned_record_id: int | str, **kwargs) PlannedRecord[source]
Get a specific planned record by ID.
Official documentation: project_management/planned_records
- Parameters:
planned_record_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(planned_record_id: int | str, data: Mapping[str, Any], **kwargs) PlannedRecord[source]
Update a planned record.
Official documentation: project_management/planned_records
- Parameters:
planned_record_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.Project(*, id: int, name: str, code: str | None = None, start_date: date | None = None, due_date: date | None = None, status: ProjectStatus, employees_assignment: ProjectEmployeeAssignment, inputed_minutes: int | None = None, is_billable: bool, fixed_cost_cents: int | None = None, labor_cost_cents: int | None = None, legal_entity_id: int, spending_cost_cents: int | None = None, client_id: int | None = None, billable_rate_type: str | None = None, total_cost_cents: int | None = None)[source]
Model for project_management_project.
- billable_rate_type: str | None
Billable rate type
- client_id: int | None
Client ID
- code: str | None
Project code
- due_date: date | None
Project due date
- employees_assignment: ProjectEmployeeAssignment
Employee assignment type
- fixed_cost_cents: int | None
Fixed cost in cents
- id: int
Project ID
- inputed_minutes: int | None
Total inputted minutes
- is_billable: bool
Whether the project is billable
- labor_cost_cents: int | None
Labor cost in cents
- legal_entity_id: int
Legal entity ID
- name: str
Project name
- spending_cost_cents: int | None
Spending cost in cents
- start_date: date | None
Project start date
- status: ProjectStatus
Project status
- total_cost_cents: int | None
Total cost in cents
- class factorialhr.ProjectEndpoint(api: ApiClient)[source]
- async activate(data: Mapping[str, Any], **kwargs) Project[source]
Activate a project.
Official documentation: project_management/projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async all(**kwargs) ListApiResponse[Project][source]
Get all projects.
Official documentation: project_management/projects
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async change_assignment(data: Mapping[str, Any], **kwargs) Project[source]
Change assignment of a project.
Official documentation: project_management/projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async change_status(data: Mapping[str, Any], **kwargs) Project[source]
Change status of a project.
Official documentation: project_management/projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async close(data: Mapping[str, Any], **kwargs) Project[source]
Close a project.
Official documentation: project_management/projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) Project[source]
Create a new project.
Official documentation: project_management/projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(project_id: int | str, **kwargs) Project[source]
Delete a project.
Official documentation: project_management/projects
- Parameters:
project_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[Project][source]
Get projects with pagination metadata.
Official documentation: project_management/projects
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(project_id: int | str, **kwargs) Project[source]
Get a specific project by ID.
Official documentation: project_management/projects
- Parameters:
project_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async soft_delete(data: Mapping[str, Any], **kwargs) Project[source]
Soft delete a project.
Official documentation: project_management/projects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async update(project_id: int | str, data: Mapping[str, Any], **kwargs) Project[source]
Update a project.
Official documentation: project_management/projects
- Parameters:
project_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.ProjectTask(*, id: int, project_id: int, subproject_id: int, task_id: int, follow_up: bool)[source]
Model for project_management_project_task.
- follow_up: bool
Whether this is a follow-up task
- id: int
Project task ID
- project_id: int
Project ID
- subproject_id: int
Subproject ID
- task_id: int
Task ID
- class factorialhr.ProjectTaskEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[ProjectTask][source]
Get all project tasks.
Official documentation: project_management/project_tasks
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async bulk_destroy(data: Mapping[str, Any], **kwargs) Sequence[ProjectTask][source]
Bulk destroy project tasks.
Official documentation: project_management/project_tasks
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[ProjectTask]
- async bulk_duplicate(data: Mapping[str, Any], **kwargs) Sequence[ProjectTask][source]
Bulk duplicate project tasks.
Official documentation: project_management/project_tasks
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[ProjectTask]
- async create(data: Mapping[str, Any], **kwargs) ProjectTask[source]
Create a new project task.
Official documentation: project_management/project_tasks
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(task_id: int | str, **kwargs) ProjectTask[source]
Delete a project task.
Official documentation: project_management/project_tasks
- Parameters:
task_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[ProjectTask][source]
Get project tasks with pagination metadata.
Official documentation: project_management/project_tasks
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(task_id: int | str, **kwargs) ProjectTask[source]
Get a specific project task by ID.
Official documentation: project_management/project_tasks
- Parameters:
task_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(task_id: int | str, data: Mapping[str, Any], **kwargs) ProjectTask[source]
Update a project task.
Official documentation: project_management/project_tasks
- Parameters:
task_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.ProjectWorker(*, id: int, project_id: int, employee_id: int, assigned: bool, inputed_minutes: int | None = None, labor_cost_cents: int | None = None, spending_cost_cents: int | None = None)[source]
Model for project_management_project_worker.
- assigned: bool
Whether the worker is assigned to the project
- employee_id: int
Employee ID
- id: int
Project worker ID
- inputed_minutes: int | None
Total inputted minutes
- labor_cost_cents: int | None
Labor cost in cents
- project_id: int
Project ID
- spending_cost_cents: int | None
Spending cost in cents
- class factorialhr.ProjectWorkerEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[ProjectWorker][source]
Get all project workers.
Official documentation: project_management/project_workers
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async bulk_assign(data: Mapping[str, Any], **kwargs) Sequence[ProjectWorker][source]
Bulk assign project workers.
Official documentation: project_management/project_workers
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[ProjectWorker]
- async bulk_create(data: Mapping[str, Any], **kwargs) Sequence[ProjectWorker][source]
Bulk create project workers.
Official documentation: project_management/project_workers
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
Sequence[ProjectWorker]
- async create(data: Mapping[str, Any], **kwargs) ProjectWorker[source]
Create a new project worker.
Official documentation: project_management/project_workers
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(worker_id: int | str, **kwargs) ProjectWorker[source]
Delete a project worker.
Official documentation: project_management/project_workers
- Parameters:
worker_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[ProjectWorker][source]
Get project workers with pagination metadata.
Official documentation: project_management/project_workers
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(worker_id: int | str, **kwargs) ProjectWorker[source]
Get a specific project worker by ID.
Official documentation: project_management/project_workers
- Parameters:
worker_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async unassign(data: Mapping[str, Any], **kwargs) ProjectWorker[source]
Unassign a project worker.
Official documentation: project_management/project_workers
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async update(worker_id: int | str, data: Mapping[str, Any], **kwargs) ProjectWorker[source]
Update a project worker.
Official documentation: project_management/project_workers
- Parameters:
worker_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.Subproject(*, id: int | None = None, name: str, project_id: int, inputed_minutes: int | None = None, labor_cost_cents: int | None = None, description: str | None = None, status: str | None = None, code: str | None = None, start_date: date | None = None, due_date: date | None = None, is_billable: bool | None = None)[source]
Model for project_management_subproject.
- code: str | None
The code of the subproject
- description: str | None
The description of the subproject
- due_date: date | None
The due date of the subproject
- id: int | None
Subproject ID
- inputed_minutes: int | None
Total inputted minutes
- is_billable: bool | None
Whether the subproject is billable
- labor_cost_cents: int | None
Labor cost in cents
- name: str
Subproject name
- project_id: int
Project ID
- start_date: date | None
The start date of the subproject
- status: str | None
The status of the subproject
- class factorialhr.SubprojectEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[Subproject][source]
Get all subprojects.
Official documentation: project_management/subprojects
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) Subproject[source]
Create a new subproject.
Official documentation: project_management/subprojects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(subproject_id: int | str, **kwargs) Subproject[source]
Delete a subproject.
Official documentation: project_management/subprojects
- Parameters:
subproject_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[Subproject][source]
Get subprojects with pagination metadata.
Official documentation: project_management/subprojects
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(subproject_id: int | str, **kwargs) Subproject[source]
Get a specific subproject by ID.
Official documentation: project_management/subprojects
- Parameters:
subproject_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async rename(data: Mapping[str, Any], **kwargs) Subproject[source]
Rename a subproject.
Official documentation: project_management/subprojects
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async update(subproject_id: int | str, data: Mapping[str, Any], **kwargs) Subproject[source]
Update a subproject.
Official documentation: project_management/subprojects
- Parameters:
subproject_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.TimeRecord(*, id: int, project_worker_id: int, attendance_shift_id: int, subproject_id: int | None = None, date: date | None = None, imputed_minutes: int | None = None, clock_in: datetime | None = None, clock_out: datetime | None = None)[source]
Model for project_management_time_record.
- attendance_shift_id: int
Attendance shift ID
- clock_in: datetime | None
Clock in time (date will always be 2000-01-01, only use for .time())
- clock_out: datetime | None
Clock out time (date will always be 2000-01-01, only use for .time())
- date: date | None
Record date
- id: int
Time record ID
- imputed_minutes: int | None
Imputed minutes
- project_worker_id: int
Project worker ID
- subproject_id: int | None
Subproject ID
- class factorialhr.TimeRecordEndpoint(api: ApiClient)[source]
- async all(**kwargs) ListApiResponse[TimeRecord][source]
Get all time records.
Official documentation: project_management/time_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async bulk_delete(data: Mapping[str, Any], **kwargs) Sequence[TimeRecord][source]
Bulk delete time records.
Official documentation: project_management/time_records
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[TimeRecord]
- async bulk_process(data: Mapping[str, Any], **kwargs) Sequence[TimeRecord][source]
Bulk process time records.
Official documentation: project_management/time_records
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[TimeRecord]
- async create(data: Mapping[str, Any], **kwargs) TimeRecord[source]
Create a new time record.
Official documentation: project_management/time_records
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(record_id: int | str, **kwargs) TimeRecord[source]
Delete a time record.
Official documentation: project_management/time_records
- Parameters:
record_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[TimeRecord][source]
Get time records with pagination metadata.
Official documentation: project_management/time_records
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(record_id: int | str, **kwargs) TimeRecord[source]
Get a specific time record by ID.
Official documentation: project_management/time_records
- Parameters:
record_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(record_id: int | str, data: Mapping[str, Any], **kwargs) TimeRecord[source]
Update a time record.
Official documentation: project_management/time_records
- Parameters:
record_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- async update_project_worker(data: Mapping[str, Any], **kwargs) TimeRecord[source]
Update project worker for a time record.
Official documentation: project_management/time_records
- Parameters:
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type: