Skip to content

Add support for ISO 4914 UPI validation#503

Closed
JonArnfred wants to merge 1 commit into
arthurdejong:masterfrom
JonArnfred:feature/iso-4914-upi
Closed

Add support for ISO 4914 UPI validation#503
JonArnfred wants to merge 1 commit into
arthurdejong:masterfrom
JonArnfred:feature/iso-4914-upi

Conversation

@JonArnfred

Copy link
Copy Markdown
Contributor

Summary

Add support for validating ISO 4914 Unique Product Identifiers (UPIs).

A UPI is a 12-character financial identifier for over-the-counter derivative products. The implementation validates:

  • the mandatory QZ prefix;
  • the restricted alphanumeric alphabet;
  • the 12-character length; and
  • the ISO 7064 Mod 31, 30 check character.

It also provides the standard compact(), validate(), is_valid(), and calc_check_digit() interfaces.

References

Testing

  • Added module documentation examples.
  • Added a dedicated doctest covering normalization, prefix, alphabet, length, and checksum validation.
  • Included four published valid UPIs sourced from the DSB, CME Group, and official regulatory material.
  • The new module achieves 100% test coverage.
  • Full test suite: 407 passed, 9 skipped.
  • Flake8 and strict mypy checks pass.

Publicly documented real UPI examples appear to be limited, so the test set currently contains four published examples. The official DSB archive requires registration, I can look into that if we need more examples.

  Add validation for Unique Product Identifiers, including the QZ prefix,
  restricted alphabet, and ISO 7064 Mod 31, 30 check character.
Comment thread tests/test_upi.doctest
@@ -0,0 +1,82 @@
test_upi.doctest - more detailed doctests for the stdnum.upi module


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing a copyright statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@arthurdejong

Copy link
Copy Markdown
Owner

Hi @JonArnfred,

Thanks for your contribution. I've merged it as 2413a52.

Kind regards

@JonArnfred

Copy link
Copy Markdown
Contributor Author

Thanks for merging.

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.

2 participants