Skip to content

Releases: EtorixDev/timelength

v2.0.5

05 Jul 12:14
Compare
Choose a tag to compare
  • Fixed an edge case with decimals that have no leading 0 (ex: .18)
  • Expanded tests to cover changes made in v2.0.3 that were unaccounted for.

v2.0.4

25 Jun 08:01
Compare
Choose a tag to compare
  • Slightly decluttered the logic of the TimeLength.parse() method.
  • Updated tests.

v2.0.3

01 Jun 11:44
Compare
Choose a tag to compare
  • Improved numeral parsing. Results from numeral input should be more accurate for larger numbers.
  • Improved Spanish parsing (probably).

v2.0.2

25 Apr 11:57
Compare
Choose a tag to compare
  • Updated outdated docstring example.
  • Various github-relevant-but-not-package-relevant changes.

v2.0.1

05 Apr 02:08
Compare
Choose a tag to compare
  • Added a few missing tests to both the English and Spanish test files that got lost during translation.
  • Modified parsing slightly to account for unconventional inputs.

v2.0.0

05 Apr 00:17
Compare
Choose a tag to compare

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 to TimeLength.result.seconds.
  • TimeLength.parsed_value was moved to TimeLength.result.invalid and TimeLength.result.valid.
  • TimeLength.passed_value was renamed to TimeLength.content.
  • Scales, such as TimeLength.Second, were moved to the TimeLength.Locale.

Features

  • TimeLength.result.success to determine the parsing outcome based on TimeLength.strict. See the README for more information.
  • Numerals (half a day), (twelve hours), etc, are supported.
  • The same TimeLength object can be reused by accessing TimeLength.content and TimeLength.parse().
  • Parsers are now in their own files found in timelength/parsers and are loaded dynamically by the Locale that uses them. Locales determine which parser to use based on the config file they are passed, which are found in timelength/locales.
  • The 2 default supported Locales are English and Spanish. Custom Locales are possible by using the CustomLocale object and a custom config file. See the README for more information.

Improvements

  • Errors will no longer be thrown during parsing even if TimeLength.strict is True. 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 disabled Scale.
  • Using ruff to format code everywhere except for the test files.

v1.1.8

19 Jan 06:57
Compare
Choose a tag to compare

The last (probably) version of the v1.x series before a complete rewrite which aims to have better code and more features.