diff --git a/snippets/explore_projects.py b/snippets/explore_projects.py index 254cc4d..10c715a 100644 --- a/snippets/explore_projects.py +++ b/snippets/explore_projects.py @@ -62,11 +62,9 @@ def main(): # Get Specific Project # -------------------- print("\nGet Specific Project") - project_id = projects[-1]["id"] # pull the last ID from the previously queried projects list + project_id = 47939 project_details = projects_api.get_project(project_id=project_id) - - # Show project - output_projects(project_list=[project_details]) # convert single project to list to use output function + print(json.dumps(project_details, indent=4)) # Get Project by Name name_to_find = "212096 - 401 FIRST STREET (College Station)" # replace with your project name @@ -77,7 +75,7 @@ def main(): # Get Project Comments # -------------------- print("\nGet Project Comments") - for project in projects: + for project in projects[:4]: try: project_comments = projects_api.get_project_comments(project_id=project["id"]) print(project_comments) diff --git a/snippets/explore_schedule.py b/snippets/explore_schedule.py index 13b9313..71e7887 100644 --- a/snippets/explore_schedule.py +++ b/snippets/explore_schedule.py @@ -23,8 +23,8 @@ def main(): scenarios_api = Scenarios(client) schedule_api = Schedule(client) - # Get Schedule Quality - # -------------------- + # Get Schedule Quality - Example 1 + # -------------------------------- # Find project by name name_to_find = "212096 - 401 FIRST STREET (College Station)" # replace with your project name project = projects_api.find_project_by_name(name=name_to_find) @@ -46,6 +46,23 @@ def main(): print(json.dumps(schedule_quality_data, indent=4)) # -------------------- + # Get Schedule Quality - Example 2 + # -------------------------------- + # Find project by id + project_id = 47939 + project = projects_api.get_project(project_id=project_id) + project_id = project["id"] + scenario_id = project["defaultScenarioId"] + + print("Get Schedule Quality") + schedule_quality_data = schedule_api.get_schedule_quality( + project_id=project_id, + scenario_id=scenario_id + ) + #with open(f"./schedule-quality-{project_id}-{scenario_id}.json", "w") as f: + # json.dump(schedule_quality_data, f, indent=4) + # -------------------- + # Get Schedule Quality Metrics # ---------------------------- print("Get Schedule Grade")