hal.times package¶
Submodules¶
hal.times.cron module¶
Cron-ify python apps with simple config files
-
class
hal.times.cron.
AppCronLock
(lock_file)[source]¶ Bases:
object
Checks if app can proceed; generates lock
-
DATETIME_FORMAT
= '%Y-%m-%d %H:%M:%S'¶
-
can_proceed
()[source]¶ Checks whether app can proceed
Returns: True iff app is not locked and times since last update < app update interval
-
hal.times.dates module¶
Datetime utils
-
class
hal.times.dates.
Day
(date_time, week_end=<Weekday.SUNDAY: 6>)[source]¶ Bases:
object
-
get_just_date
()[source]¶ Parses just date from date-time
Returns: Just day, month and year (setting hours to 00:00:00)
-
get_last_weekday
(including_today=False)[source]¶ Gets last week day
Parameters: including_today – If today is sunday and requesting next sunday Returns: Date of last monday, tuesday ..
-
get_next_weekday
(including_today=False)[source]¶ Gets next week day
Parameters: including_today – If today is sunday and requesting next sunday Returns: Date of next monday, tuesday ..
-
is_date_in_between
(start, end, include_start=True, include_end=True)[source]¶ Checks if date is in between dates
Parameters: - start – Date cannot be before this date
- end – Date cannot be after this date
- include_start – True iff date is start
- include_end – True iff date is end
Returns: True iff date is in between dates
-
hal.times.profile module¶
Tired of formatting ETA times? This is just for you
hal.times.utils module¶
Parse, convert times formats