chrono.utility - Utility functions
Various utility functions used by the other modules.
-
chrono.utility.cmp(a, b)
- Compares a to b, returns -1 if smaller, 0 if equal, and 1 if greater.
-
chrono.utility.int_day(value)
- Converts a day value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.DayError
is raised.
-
chrono.utility.int_hour(value)
- Converts an hour value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.HourError
is raised.
-
chrono.utility.int_minute(value)
- Converts a minute value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.MinuteError
is raised.
-
chrono.utility.int_month(value)
- Converts a month value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.MonthError
is raised.
-
chrono.utility.int_second(value)
- Converts a second value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.SecondError
is raised.
-
chrono.utility.int_week(value)
- Converts a week value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.WeekError
is raised.
-
chrono.utility.int_year(value)
- Converts a year value to an integer. If value is invalid
(non-numeric string, or invalid type), chrono.error.YearError
is raised.
-
chrono.utility.integer(value)
- Converts value to an integer. If value is a sequence or
dictionary, members will be recursively converted to integers.
Raises TypeError if value (or members) isn’t a string or
integer, or ValueError if value couldn’t be converted.