metrics package

Submodules

metrics.date_utils module

Various date utility functions

metrics.date_utils.lastMonthDay(month: str) str[source]

expects YYYY-MM as input returns YYYY-MM-XX where XX is the last day for month MM

metrics.date_utils.leapYear(year: int) bool[source]

return True for leap years

metrics.date_utils.lookAhead(offset: int, from_date: str = Timestamp('2024-05-08 05:45:37.460144'))[source]
metrics.date_utils.lookBack(offset: int, from_date: str = Timestamp('2024-05-08 05:45:37.460187'))[source]
metrics.date_utils.monthBegin(from_date: str = Timestamp('2024-05-08 05:45:37.460191'))[source]

Return with the first for the date

metrics.date_utils.splitMonthTable(df: DataFrame) DataFrame[source]

split the table into two entries per month

metrics.date_utils.weekdays(from_date: str, to_date: str)[source]

Returns the number of weekdays between the dates using np

metrics.index module

metrics.notion module

Notion related functions and classes

class metrics.notion.Allocations(token: str | None = None, database_id: str = '')[source]

Bases: Notion

The class for allocations

data: DataFrame
get_allocations() None[source]
class metrics.notion.Crew(token: str | None = None, database_id: str = '')[source]

Bases: Notion

The class for crew data

data: DataFrame
get_crew() None[source]
class metrics.notion.Financials(token: str | None = None, database_id: str = '')[source]

Bases: Notion

The class for finance data

data: DataFrame
get_financials() None[source]
class metrics.notion.Notion(token: str | None = None, database_id: str = '')[source]

Bases: object

I’M A DOCSTRING SHORT AND STOUT

database_id: str
fetch_data(database_id) Response[source]
token: str
class metrics.notion.OKR(token: str | None = None, database_id: str = '')[source]

Bases: Notion

The class for OKR’s

data: DataFrame
get_figure_initiatives(search_period=None, fnTableHeight=None, color_head='paleturquoise', color_cells='lavender') Figure[source]
get_figure_key_result(search_period=None) bar[source]
get_okr() None[source]
class metrics.notion.WorkingHours(token: str | None = None, database_id: str = '')[source]

Bases: Notion

The class for working hour handling

data: DataFrame
get_workinghours() None[source]

metrics.supplementary_data module

Tempo related functions and classes

class metrics.supplementary_data.SupplementaryData(config_path: str, financials: DataFrame, working_hours: DataFrame)[source]

Bases: object

SupplementaryData data class

costs: DataFrame
financials: DataFrame
internal_keys: DataFrame
load(users: Series) None[source]
rates: DataFrame
rates_path: str
working_hours: DataFrame

metrics.tempo_config module

Config module

metrics.tempo_data module

Tempo related functions and classes

class metrics.tempo_data.TempoData(base_url: str = 'https://api.tempo.io/core/3', tempo_key: str | None = None)[source]

Bases: object

Tempo data class.

byDay() DataFrame[source]

returns aggregated time and billable time grouped by date, user and issue key

byEggBaskets() DataFrame[source]

returns aggregated billable income grouped by issue key group, user and time box (30, 60, 90)

byGroup() DataFrame[source]

returns aggregated time and billable time grouped by date, user and group

byTimeType() DataFrame[source]

returns aggregated time and time type grouped by date, user and group

byTotalGroup(days_back) DataFrame[source]

returns aggregated billable time grouped by issue key group and user

byUser(working_hours: DataFrame) DataFrame[source]

returns aggregated time and billable time grouped by user

client: Tempo
data: DataFrame
firstEntry(user, start) Timestamp[source]
getUsers() Series[source]

returns list of users

getYear(year) DataFrame[source]

returns a dataFrame with entries for the given year

injectRates(rates: DataFrame) None[source]

Modify data by merging in the given rates data

lastEntry(user, stop) Timestamp[source]
lastYear() DataFrame[source]

returns a dataFrame with entries for the previous year

last_year: int
load(from_date: str = '1970-01-01', to_date: str = '2024-05-08') None[source]

Fetch and populate data from Tempo for the given date range

missingRatesTable(fnTableHeight=None, color_head='paleturquoise', color_cells='lavender') Figure[source]
padTheData(working_hours: DataFrame) None[source]

creates the self.padded_data padded with zero data for each User, an entry for the ZP group will be added for each date >= min(Date) && <= max(Date) Key: ZP-1, Time: 0, Billable: 0, Group: ZP, Internal: 0, Currency: EUR, Rate: 0, Income: 0

padded_data: DataFrame
ratesTable(fnTableHeight=None, color_head='paleturquoise', color_cells='lavender') Figure[source]
raw: DataFrame
rawRatesTable() DataFrame[source]
tableByUser(working_hours, fnTableHeight=None, color_head='paleturquoise', color_cells='lavender') Figure[source]
teamRolling7(to_sum) DataFrame[source]

returns rolling 7 day sums for Billable and non Billable time grouped by user

teamRolling7Relative(costs: Series) DataFrame[source]

returns rolling 7 day sums for Billable and non Billable time grouped by user, relative to the costs

thisYear() DataFrame[source]

returns a dataFrame with entries for the current year

this_year: int
totalHours(user, start, stop=None)[source]
userRolling7(to_sum) DataFrame[source]

returns rolling 7 day sums for Billable and non Billable time grouped by user

zeroOutBillableTime(keys: DataFrame) None[source]

Sets billable time to zero (0) for internal project keys

Module contents