get_project_performance
imerit_ango.sdk.SDK.
get_project_performance(project_id, interval, batches)
Get all performance metrics of a project.
Parameters
- project_id: string - The unique identifier for the project. You can find the project ID in the user interface or retrieve it using the - list_projectsfunction.
 
- interval: list[datetime], default None - Format: [start_datetime, end_datetime] 
- Example: - [datetime.now() - timedelta(days=7), datetime.now()]
 
- batches: list[str], default None - Filter performance metrics by batch (e.g., only get tasks belonging to the batch specified) 
- Example - ['batch_1', 'batch_2']
 
Returns:
- output: dict - A dictionary containing the result of the operation. 
 
Example
Get all performance metrics:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')
ango_sdk = SDK(api_key)
sdk_response = ango_sdk.get_project_performance(project_id)curl -X POST "https://imeritapi.ango.ai/v2/performance/$PROJECT_ID" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{}'Filter metrics by time and batches:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from datetime import datetime, timedelta
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')
ango_sdk = SDK(api_key)
sdk_response = ango_sdk.get_project_performance(project_id=project_id,
                                                interval=[datetime.now() - timedelta(days=7), datetime.now()],
                                                batches=["Batch-1", "Batch-2"])curl -X POST "https://imeritapi.ango.ai/v2/performance/$PROJECT_ID" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "batches": ["68b3fb784e2a51908a5cd634", "68ad65487d1dcb702fa629eb"],
    "interval": ["2020-01-01T00:00:00Z", "2020-01-08T00:00:00Z"]
  }'Last updated

