1. Products
  2.   Project Management
  3.   Python
  4.   Aspose.Tasks Cloud Python SDK

Aspose.Tasks Cloud Python SDK

 
 

Create, Convert MS Project Files via Python REST API

Ptyhon Project Management Cloud API enables Project Managers to Generate, Read, Manipulate, or Convert Microsoft Project MPT, MPP, MPX & Oracle Primavera XER, XML and PrimaveraP6XML Files via Python REST API.

What is Aspose.Tasks Cloud Python SDK?

Aspose.Tasks Cloud Python SDK is a handy collection of tools that empowers software developers to smoothly handle project management files like Microsoft Project (MPP) and Oracle Primavera formats. This SDK comes with various features to help you create, manage, and convert project files, giving you the necessary tools to develop strong project management applications. By using this cloud-based SDK, software developers can effortlessly add project management functionalities to their Python applications without needing the actual Microsoft Project or Primavera software installed. A big plus of this SDK is that it frees you from relying on Microsoft Project or Primavera. Because the SDK functions in the cloud, you can seamlessly add project management features to Python apps that work on different systems like Windows, macOS, and Linux. This setup removes worries about compatibility issues.

The Aspose.Tasks Cloud Python SDK is a great tool to help you automate and simplify your project management tasks. It’s handy for working with Microsoft Project (MPT, MPP, MPX) and Primavera P6 (XER, XML) files. By using a few lines of code, developers can convert project files to various formats like HTML, PDF, XPS, TXT, CSV, XLSX, SVG, TIFF, JPEG, PNG, BMP, and more. The Aspose.Tasks Cloud Python SDK is a handy tool. With it, you can do many things like adjusting project document properties, updating tasks, handling resources, managing calendars, making reports, linking tasks, and reorganizing tasks. It enables scalability and teamwork by letting groups reach and edit project files from diverse places. With Aspose.Tasks Cloud, you have all the tools required to seamlessly blend project management duties, whether you need to convert files, manage task sequences, or generate reports.

Previous Next

Getting Started with Aspose.Tasks Cloud Python SDK

The recommend way to install Aspose.Tasks Cloud Python SDK is via Pypi. Please use the following commands for a smooth installation.

Install Aspose.Tasks for Python via .NET via Pypi

pip install asposetaskscloud
You can download the directly from Aspose.Tasks Release page

Convert Project Management Files via Python

One of the most useful features of Aspose.Tasks Cloud Python SDK is its ability to convert project management files between various formats. The SDK allows developers to convert Microsoft Project files (MPP) into formats such as PDF, XML, XLSX, and Primavera formats (P6XML and XER), making it easy to share project information across platforms. This code sample demonstrates how software developers can upload an MPP file to cloud storage and convert it to PDF format using the SDK.

How to Convert MPP Files to PDF via Python REST API?


	api_client = asposetaskscloud.ApiClient()
	api_client.configuration.host = 'https://api.aspose.cloud'
	api_client.configuration.api_key['api_key'] = 'MY_CLIENT_SECRET'
	api_client.configuration.api_key['app_sid'] = 'MY_CLIENT_ID'
	tasks_api = asposetaskscloud.TasksApi(api_client)

	file_name = 'SomeSeriousPlan.mpp'

	upload_request = asposetaskscloud.models.requests.UploadFileRequest(os.path.join(self.remote_test_folder, file_name), file_name)
	upload_result = self.tasks_api.upload_file(upload_request)

	request = asposetaskscloud.models.requests.GetReportPdfRequest(file_name, ReportType.MILESTONES)
	result = tasks_api.get_report_pdf(request)

Project Task Management in Cloud Apps

Aspose.Tasks Cloud Python SDK provides comprehensive APIs for creating and managing tasks in project files inside Python cloud-base applications. with just a couple of lines of code software developers can create, update, delete and assign tasks, set task dependencies, define constraints, and manage task baselines. This feature allows you to automate and manage complex project schedules with ease. In the following example, users can create two tasks and set a dependency between them using a "Finish-to-Start" link. Task dependencies are crucial in managing project workflows effectively.

How to Create and Manage Tasks inside Python Apps?

# Create a new task in the project
task = models.Task(name="Develop Backend", start="2024-10-23", duration=5)
created_task = api.create_task(file_name, task)

# Set task dependency (finish-to-start)
dependent_task = models.Task(name="Develop Frontend", start="2024-10-30", duration=5)
created_dependent_task = api.create_task(file_name, dependent_task)
dependency = models.TaskLink(predecessor_uid=created_task.uid, successor_uid=created_dependent_task.uid, link_type="FinishToStart")
api.create_task_link(file_name, dependency)

Handling Project Calendars via Python API

Managing project schedules requires proper handling of work hours, holidays, and non-working days. Aspose.Tasks Cloud Python SDK provides features for managing project calendars, allowing software developers to define working times, holidays, custom work schedules and many more inside cloud-based python applications. The following example shows how software developers can add a calendar to a project inside cloud-based Python applications.

How to Add a Calendar to a Project via Python REST API?

filename = 'Home_move_plan.mpp'
self.upload_file(filename)
first_day = WeekDay()
first_day.day_type = DayType.SUNDAY
first_day.day_working = False
second_day = WeekDay()
second_day.day_type = DayType.MONDAY
second_day.day_working = True
second_day.from_date = datetime(2000, 1, 1, 8)
second_day.to_date = datetime(2000, 1, 1, 17)
first_working_time = WorkingTime()
first_working_time.from_time = datetime(2000, 1, 1, 8)
first_working_time.to_time = datetime(2000, 1, 1, 13)
second_working_time = WorkingTime()
second_working_time.from_time = datetime(2000, 1, 1, 14)
second_working_time.to_time = datetime(2000, 1, 1, 17)
second_day.working_times = [first_working_time, second_working_time]
calendar = Calendar()
calendar.name = 'My new calendar'
calendar.days = [first_day, second_day]
calendar.is_base_calendar = False
calendar.is_baseline_calendar = False
request = PostCalendarRequest(filename, calendar)
post_result = self.tasks_api.post_calendar(request)
self.assertIsNotNone(post_result)
self.assertIsInstance(post_result, CalendarItemResponse)
get_result = self.tasks_api.get_calendar(GetCalendarRequest(filename, post_result.calendar_item.uid))
self.assertEqual('My new calendar', get_result.calendar.name)
self.assertEqual(7, len(get_result.calendar.days))
monday = next(d for d in get_result.calendar.days if d.day_type == DayType.MONDAY)
self.assertEqual(2, len(monday.working_times))
self.assertEqual(first_working_time.from_time.strftime("%H:%M:%S"), monday.working_times[0].from_time.strftime("%H:%M:%S"))
self.assertEqual(first_working_time.to_time.strftime("%H:%M:%S"), monday.working_times[0].to_time.strftime("%H:%M:%S"))
self.assertEqual(second_working_time.from_time.strftime("%H:%M:%S"), monday.working_times[1].from_time.strftime("%H:%M:%S"))
self.assertEqual(second_working_time.to_time.strftime("%H:%M:%S"), monday.working_times[1].to_time.strftime("%H:%M:%S"))

Add Gantt Charts & Reports to Project Files

Aspose.Tasks Cloud Python SDK makes it easy for software developers to generate visual reports, such as Gantt charts and task progress reports using Python REST API. These charts help project managers visualize task timelines, dependencies, and overall progress, which can be essential for stakeholders and team members. Here is an example that demonstrates how to export a project file to a PDF that could serve as a Gantt chart, providing visual insights into the project’s progress and structure.

How to Export Project to Gantt Chart (PDF) inside Cloud-Base Python Apps?

# Export project to PDF to visualize it as a Gantt chart
response = api.export(file_name, 'pdf')
with open('gantt_chart.pdf', 'wb') as f:
    f.write(response)