https://github.com/grv96/hm_duration
Class HM_Duration represents durations as a number of hours and a number of minutes. Among other functionalities, it offers arithmetic operations, string representation and instantiation from a string representation.
https://github.com/grv96/hm_duration
duration hours minutes time
Last synced: 7 months ago
JSON representation
Class HM_Duration represents durations as a number of hours and a number of minutes. Among other functionalities, it offers arithmetic operations, string representation and instantiation from a string representation.
- Host: GitHub
- URL: https://github.com/grv96/hm_duration
- Owner: GRV96
- License: mit
- Created: 2021-06-11T23:10:01.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T15:44:12.000Z (almost 5 years ago)
- Last Synced: 2023-03-06T04:24:10.864Z (over 3 years ago)
- Topics: duration, hours, minutes, time
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hm_duration
Package hm_duration helps working with durations in hours and minutes. Among
other functionalities, it offers arithmetic operations, comparison, string
representation and instantiation from a string representation.
### Package content
**HM_Duration**
This class represents durations as a number of hours and a number of minutes.
**DURATION_STR_PATTERN**
This constant stores regular expression "-?\d{1,}:\d{2}". Strings that match
it represent durations, and static method HM_Duration.from_str can use them to
instantiate HM_Duration.
**str_repr_duration**
This function determines whether a string matches DURATION_STR_PATTERN. If it
does, the string can be used to instantiate HM_Duration.