Releases: EtorixDev/timelength
Releases · EtorixDev/timelength
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
Rewritten to hopefully achieve a cleaner code base and better user experience.
Breaking
- Only officially supporting
Python 3.8
and above. TimeLength.total_seconds
was moved toTimeLength.result.seconds
.TimeLength.parsed_value
was moved toTimeLength.result.invalid
andTimeLength.result.valid
.TimeLength.passed_value
was renamed toTimeLength.content
.- Scales, such as
TimeLength.Second
, were moved to theTimeLength.Locale
.
Features
TimeLength.result.success
to determine the parsing outcome based onTimeLength.strict
. See theREADME
for more information.- Numerals (
half a day
), (twelve hours
), etc, are supported. - The same
TimeLength
object can be reused by accessingTimeLength.content
andTimeLength.parse()
. - Parsers are now in their own files found in
timelength/parsers
and are loaded dynamically by theLocale
that uses them.Locale
s determine which parser to use based on the config file they are passed, which are found intimelength/locales
. - The 2 default supported
Locale
s areEnglish
andSpanish
. CustomLocale
s are possible by using theCustomLocale
object and a custom config file. See theREADME
for more information.
Improvements
- Errors will no longer be thrown during parsing even if
TimeLength.strict
isTrue
. If "invalid" (as determined by the relevant parser) inputs are found, it will be up to the user to determine how to proceed. Errors are still thrown if the config is invalid, or if a conversion method is used for a disabledScale
. - Using
ruff
to format code everywhere except for the test files.