Skip to content

[codex] Normalize XBRL currency unit identifiers#852

Open
gyx09212214-prog wants to merge 1 commit into
dgunning:mainfrom
gyx09212214-prog:codex/normalize-currency-unit
Open

[codex] Normalize XBRL currency unit identifiers#852
gyx09212214-prog wants to merge 1 commit into
dgunning:mainfrom
gyx09212214-prog:codex/normalize-currency-unit

Conversation

@gyx09212214-prog

Copy link
Copy Markdown

Summary

  • Add normalize_currency_unit() to extract ISO 4217 codes from raw XBRL currency unit identifiers.
  • Preserve raw unit_ref and add a normalized currency field to facts generated by FactsView.
  • Cover USD, iso4217:USD, UNIT_STANDARD_HKD_*, and unknown unit formats.

Why this matters

Foreign issuer filings can use raw unit identifiers like UNIT_STANDARD_HKD_*. A normalized currency column makes filtering, display, and database storage reliable without losing the original XBRL unit reference.

Refs #850.

Validation

  • python -m py_compile edgar/xbrl/currency.py edgar/xbrl/facts.py tests/xbrl/test_currency_unit_normalization.py
  • Direct helper assertions passed.
  • git diff --check

Note: full pytest was not run locally because this environment does not have pytest installed.

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