call_report.core.Quarter#

class call_report.core.Quarter(*values)[source]#

Bases: IntEnum

A calendar quarter, ordered Q1 (Jan-Mar) through Q4 (Oct-Dec).

Members compare and sort in calendar order, since the underlying values are simply 1 through 4.

Examples

>>> Quarter.Q1 < Quarter.Q4
True
property first_month: int[source]#

Return the first calendar month of this quarter.

This is the month a quarter begins in, as a plain 1-12 integer.

Returns:
int

1, 4, 7, or 10.

Examples

>>> Quarter.Q2.first_month
4
property last_month: int[source]#

Return the last calendar month of this quarter.

This is also the quarter’s quarter-end month, the value used throughout this package to build quarter-end dates.

Returns:
int

3, 6, 9, or 12.

Examples

>>> Quarter.Q2.last_month
6
property months: tuple[int, int, int][source]#

Return the three calendar months that make up this quarter.

Combines first_month with the two months that follow it.

Returns:
tuple[int, int, int]

The months in calendar order, e.g. (4, 5, 6) for Q2.

Examples

>>> Quarter.Q2.months
(4, 5, 6)