biometrics_tracker.model.datapoints module

class biometrics_tracker.model.datapoints.BloodGlucose(value: int, uom: BG)

Bases: object

Contains properties to record a blood glucose level, exclusive of date and time

static label() str

Provides a string label to be used for screens and output

Returns

a label for use on displays and in reports

Return type

str

class biometrics_tracker.model.datapoints.BloodGlucoseDP(person_id: str, taken: datetime, note: str, data: BloodGlucose, type: DataPointType = DataPointType.BG)

Bases: DataPoint

This class implements the complete set of information related to a record of a blood glucose reading

class biometrics_tracker.model.datapoints.BloodPressure(systolic: int, diastolic: int, uom: Pressure)

Bases: object

Contains properties to record a blood pressure, exclusive of date and time

static label() str

Provides a string label to be used for screens and output

Returns

a label for use on displays and in reports

Return type

str

class biometrics_tracker.model.datapoints.BloodPressureDP(person_id: str, taken: datetime, note: str, data: BloodPressure, type: DataPointType = DataPointType.BP)

Bases: DataPoint

This class implements the complete set of information related to a record of a blood pressure reading

class biometrics_tracker.model.datapoints.BodyTemperature(value: Decimal, uom: Temperature)

Bases: object

Contains properties to record a body temperature, exclusive of date and time

static label() str

Provides a string label to be used for screens and output

Returns

a label for use on displays and in reports

Return type

str

class biometrics_tracker.model.datapoints.BodyTemperatureDP(person_id: str, taken: datetime, note: str, data: BodyTemperature, type: DataPointType = DataPointType.BODY_TEMP)

Bases: DataPoint

This class implements the complete set of information related to a record of a body temperature reading

class biometrics_tracker.model.datapoints.BodyWeight(value: Decimal, uom: Weight)

Bases: object

Contains properties to record a body weight, exclusive of date and time :type uom: Union(type(biometrics_tracker.model.uoms.Weight.POUNDS), type(biometrics_tracker.model.uoms.Weight.KILOS)

static label() str

Provides a string label to be used for screens and output

Returns

a label for use on displays and in reports

Return type

str

class biometrics_tracker.model.datapoints.BodyWeightDP(person_id: str, taken: datetime, note: str, data: BodyWeight, type: DataPointType = DataPointType.BODY_WGT)

Bases: DataPoint

This class implements the complete set of information related to a record of a body weight

class biometrics_tracker.model.datapoints.DataPoint(person_id: str, taken: datetime, note: str, data: Any, type: DataPointType)

Bases: object

This a base class for datapoint records. It includes properties for person ID, the date time the reading was taken and a note.

class biometrics_tracker.model.datapoints.DataPointType(value)

Bases: Enum

This Enum enumerates each of the types of datapoints supported by the application

class biometrics_tracker.model.datapoints.FrequencyType(value)

Bases: Enum

An Enum subclass that represents the various frequencies a ScheduleEntry can have; Hourly, Daily, Weekly, etc.

class biometrics_tracker.model.datapoints.Person(id: str, name: str, dob: date, age: int = 0)

Bases: object

Contains the data relevant to a person, including a list of Tracking Config instances to record the datapoints tracked for an individual

class biometrics_tracker.model.datapoints.Pulse(value: int, uom: Rate)

Bases: object

Contains properties to record a pulse rate, exclusive of date and time

static label() str

Provides a string label to be used for screens and output

Returns

a label for use on displays and in reports

Return type

str

class biometrics_tracker.model.datapoints.PulseDP(person_id: str, taken: datetime, note: str, data: Pulse, type: DataPointType = DataPointType.PULSE)

Bases: DataPoint

This class implements the complete set of information related to a record of a pulse reading

class biometrics_tracker.model.datapoints.ScheduleEntry(person_id: str, seq_nbr: int, frequency: FrequencyType, dp_type: DataPointType, note: str, weekdays: list[biometrics_tracker.model.datapoints.WeekDay], days_of_month: list[int], interval: Optional[int], when_time: time, starts_on: date, ends_on: date, suspended: bool = False, last_triggered: Optional[datetime] = None)

Bases: object

The class contains the information pertaining to a single entry in a periodic schedule. Frequency types are Once, Monthly, Weekly and Hourly. Schedule entries with type Once specify a date and time. Schedule entries with type Monthly specify one or more day of the month. Schedule entries with type Weekly specify one or more days of the week. Monthly, Weekly and Hourly schedule entries also specify an interval parameter, e.g. used to schedule events for the 3rd Wed of every month. All schedules have start and end date/times and record the last time the entry was triggered.

static get_weekday_dates(weekday: WeekDay) list[datetime.date]

Returns a list of dates for a day of the week for the current month

Parameters

weekday (biometrics_tracking.model.datapoints.EntrySchedule) – The weekday for which dates are to be returned

Returns

the dates within the current month the fall on the specified day of the week

Return type

list[date]

classmethod max_day(month: int)

Get the max number of days in the specified month

Parameters

month (int) –

Returns

number of days in the specified month

Return type

int

next_occurrence_today(today: date) list[datetime.datetime]

Return a list containing the date/times that the schedule will be triggered on the specified day.

Parameters

today (datetime) – the date for which the schedules will be examined

Returns

a list of the trigger date/times

Return type

list[datetime]

class biometrics_tracker.model.datapoints.TrackingConfig(dp_type: DataPointType, default_uom: UOM, tracked: bool)

Bases: object

Indicates that a particular datapoint is recorded for a particular person

class biometrics_tracker.model.datapoints.WeekDay(value)

Bases: Enum

An Enum representing the days of the week, for use in scheduling. Note the int value of each day of the week is one greater than the corresponding value returned by the datetime.weekday function.

biometrics_tracker.model.datapoints.dptype_dp_map = {<DataPointType.BG: 2>: <class 'biometrics_tracker.model.datapoints.BloodGlucose'>, <DataPointType.BODY_TEMP: 5>: <class 'biometrics_tracker.model.datapoints.BodyTemperature'>, <DataPointType.BODY_WGT: 1>: <class 'biometrics_tracker.model.datapoints.BodyWeight'>, <DataPointType.BP: 3>: <class 'biometrics_tracker.model.datapoints.BloodPressure'>, <DataPointType.PULSE: 4>: <class 'biometrics_tracker.model.datapoints.Pulse'>}

A dict[model.datapoints.DataPointType, BloodGlucose, BodyTemperature, etc.] that provides a mapping between each model.datapoint.DataPointType value and the class that is used to represent the value of the metric.

Property dptype_dp_map

biometrics_tracker.model.datapoints.dptype_label_map = {<DataPointType.BODY_WGT: 1>: 'Body Weight', <DataPointType.BG: 2>: 'Blood Glucose', <DataPointType.BP: 3>: 'Blood Pressure', <DataPointType.PULSE: 4>: 'Pulse', <DataPointType.BODY_TEMP: 5>: 'Temperature'}

A dict[str, model.datapoints.DataPointType] that provides a mapping between the label metric type and the corresponding DataPointType

Property dptype_label_map

biometrics_tracker.model.datapoints.dptype_name_map = {'BG': DataPointType.BG, 'BODY_TEMP': DataPointType.BODY_TEMP, 'BODY_WGT': DataPointType.BODY_WGT, 'BP': DataPointType.BP, 'PULSE': DataPointType.PULSE}

A dict[str, model.datapoints.DataPointType] that provides a mapping between the name property of each DataPointType value and the corresponding value

Property dptype_name_map

biometrics_tracker.model.datapoints.dptype_uom_map = {<DataPointType.BG: 2>: <enum 'BG'>, <DataPointType.BODY_TEMP: 5>: <enum 'Temperature'>, <DataPointType.BODY_WGT: 1>: <enum 'Weight'>, <DataPointType.BP: 3>: <enum 'Pressure'>, <DataPointType.PULSE: 4>: <enum 'Rate'>}

A dict[model.datapoints.DatapointType, uoms.UOM] that provides a mapping between each model.datapoints.DataPointType value and the model.uoms.UOM derived Enum the represents the associated unit of measure

Property dptype_uom_map

biometrics_tracker.model.datapoints.metric_union

A Union type that includes the metric classes (BloodPress, BloodGlucose, etc)

alias of Union[BloodGlucose, BloodPressure, Pulse, BodyTemperature, BodyWeight]