Skip to content

Conversation

@bramp
Copy link

@bramp bramp commented Aug 16, 2025

Sorry this is perhaps too many changes in one pull request, but in brief:

  • Fixed the pre-commit setup for modern python
  • Fixed/Implemented the additional information API, to correctly extract additional courier/package info
  • Supported new checksums on non-integer values (e.g mod_37_36)
  • Implemented Luhn and mod_37_36 checksum algorithms
  • Changed the public API to allow validations to be skipped, and to return a set of possible matching TrackingNumbers
  • Finally update to the latest tracking_number_data

bramp added 10 commits August 15, 2025 13:54
… to make this available.

For example, S10 provides a table of information for each courier. This is now available via the courier_info property on TrackingNumber.

If a additional validator is provided, that is now correctly used, instead of the old behaviour that would fail if the additional information was missing. This matches the behaviour of the upstream ruby library, and makes the library more generous at parsing valid tracking numbers, that we don't have additional information for.
…t. Additionally added two new checksum algorithsm, Luhn, and Mod_37_36.

Newer formats, such as DPD, require alphanumeric serial numbers / check digits. The upstream library now supports this, and moves the casting to ints into checksum algorithsm, which I've copied.
…turned, as well as returning a list of possible candidates. This helps in the situation where we may not be able to identify the exact courier from the number, and could possibly use some external data source to make the final determination.
…to expose the check digit (mainly to aid in debugging but could in future be part of the official API for generating tracking numbers).
@bramp bramp mentioned this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant