Skip to content

Add locale-aware number/currency/date parsing#251

Merged
JE-Chen merged 1 commit into
devfrom
feat/locale-parse-batch
Jun 20, 2026
Merged

Add locale-aware number/currency/date parsing#251
JE-Chen merged 1 commit into
devfrom
feat/locale-parse-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 20, 2026

Copy link
Copy Markdown
Member

Dependency-gated batch (approved under 批准全部). Full layers + tests + EN/Zh v43 docs + README.

Feature (utils/locale_parse, optional babel)

  • parse_decimal / parse_number (locale strings -> float/int, e.g. "1.234,56" de_DE -> 1234.56), format_decimal / format_currency (ISO 4217) / format_date (ISO string or date -> short/medium/long/full). Uses Babel CLDR data so OCR/UI text parses and formats correctly across locales.
  • babel is an optional [locale] extra, imported lazily — the package stays importable without it and a clear error is raised only when a function is called without Babel. Functional tests run under importorskip; wiring/facade always verified.
  • Executor AC_parse_decimal / AC_parse_number / AC_format_decimal / AC_format_currency / AC_format_date; MCP ac_*; Builder under Data.

Verification

  • 8 tests pass (parse de_DE/en_US, parse_number, format decimal/currency, format_date short, de_DE round-trip, executor round-trip, wiring, facade) — functional ones under importorskip(babel); ruff clean; radon no CC≥C; bandit clean; PySide6-free.
  • Stacked on image-dedup (Add perceptual-hash image dedupe #250); rebased cleanly onto dev.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 29 complexity · 0 duplication

Metric Results
Complexity 29
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 2b7bd07 into dev Jun 20, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/locale-parse-batch branch June 20, 2026 04:22
@sonarqubecloud

Copy link
Copy Markdown

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