Cost
Query aggregated job-run costs via dt cost view.
Returns daily cost rows grouped by owner, job type, environment, and
instance type. Date arguments are UTC calendar days (YYYY-MM-DD).
Example::
from datetime import date
from datatailr import Cost
# Current UTC month through now (CLI defaults)
rows = Cost.view()
# Explicit range
rows = Cost.view(begin="2026-03-01", end="2026-03-25")
rows = Cost.view(begin=date(2026, 3, 1), end=date(2026, 3, 25))
view
staticmethod
View daily costs for a UTC date range (dt cost view).
Parameters:
-
(beginstr | date | datetime | None, default:None) –Range start date in UTC (
YYYY-MM-DD), or a :class:~datetime.date/ :class:~datetime.datetime. Defaults to the first day of the current month when omitted (or the month ofendwhen onlyendis set). -
(endstr | date | datetime | None, default:None) –Range end date in UTC (
YYYY-MM-DD), or a :class:~datetime.date/ :class:~datetime.datetime. Defaults to now when omitted.
Returns:
-
list[dict[str, Any]]–A list of cost rows. Each row is a dict with keys
date,owner,job_type,environment,instance_type, andcost.
Raises:
-
TypeError–If begin/end have an unsupported type, or the API response is not a list.