Skip to content

Latest commit

 

History

History
253 lines (160 loc) · 16.1 KB

File metadata and controls

253 lines (160 loc) · 16.1 KB

Metrics

(metrics)

Overview

Available Operations

revenue

Revenue metrics for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.metrics.revenue(from_="2023-01-01", to="2023-12-31", currency="USD")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
from_ str ✔️ N/A 2023-01-01
to str ✔️ N/A 2023-12-31
currency Optional[str] N/A USD
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetRevenueResponseSchema

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

profit

Profit metrics for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.metrics.profit(from_="2023-01-01", to="2023-12-31", currency="USD")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
from_ str ✔️ N/A 2023-01-01
to str ✔️ N/A 2023-12-31
currency Optional[str] N/A USD
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetProfitResponseSchema

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

burn_rate

Burn rate metrics for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.metrics.burn_rate(from_="2023-01-01", to="2023-12-31", currency="USD")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
from_ str ✔️ N/A 2023-01-01
to str ✔️ N/A 2023-12-31
currency Optional[str] N/A USD
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[models.GetBurnRateResponseSchema]

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

runway

Runway metrics for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.metrics.runway(from_="2023-01-01", to="2023-12-31", currency="USD")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
from_ str ✔️ N/A 2023-01-01
to str ✔️ N/A 2023-12-31
currency Optional[str] N/A USD
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

float

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

expenses

Expense metrics for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.metrics.expenses(from_="2023-01-01", to="2023-12-31", currency="USD")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
from_ str ✔️ N/A 2023-01-01
to str ✔️ N/A 2023-12-31
currency Optional[str] N/A USD
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetExpensesResponseSchema

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

spending

Spending metrics for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.metrics.spending(from_="2023-01-01", to="2023-12-31", currency="USD")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
from_ str ✔️ N/A 2023-01-01
to str ✔️ N/A 2023-12-31
currency Optional[str] N/A USD
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[models.SpendingResultArray]

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*