Add utility for validating security identifiers#159
Conversation
|
Thanks for this, isn't this a standard rule set? If it is, I'd like to split it up. A checker (added to GitHub Actions) that checks PRs on valid codes and then an automated GitHub Actions run on push to What do you think? |
|
Yes it just checks values against the standard rules for ISINs etc, and also clears .0 suffixes. Sounds like a good idea. I'll update the PR today or tomorrow. |
|
I've added a third commit ( Pull-request validationA new It audits both the PR database and its base revision using the same validator, then compares the findings. Only identifier problems introduced by the PR are shown as warning annotations. This means:
Maintenance on
|
This PR adds a utility for validating security identifiers in the source CSV database.
I believe it's important to maintain that the project is primarily financial reference data. For that reason, the implementation:
scripts/financedatabaseAPIpython-stdnumpackage instead of implementing checksum algorithms locallypython-stdnumonly as a development dependencyThe motivation is that identifier accuracy is part of maintaining a high-quality reference database, and these checks can detect malformed values deterministically before they are merged.
Validation performed
The utility checks:
Usage
Report-only mode is the default:
The report includes the CSV file, line number, symbol, field, value, and validation problem.
After reviewing the report, deterministic cleanup can be applied explicitly:
Apply safety
--applydistinguishes between repairable, removable, and review-only values.It can:
It does not automatically change:
Ambiguous cases are therefore left for manual review.
Current database results
The initial audit checked:
It found:
Applying the deterministic cleanup produced:
The utility and resulting data changes are kept in separate commits so the effect of running
--applycan be reviewed independently.