Simple fastapi-server to convert amount strings (in Chinese characters or Arabic numerals) into numbers and automatically perform currency exchange.
Find a file
2025-10-14 17:42:15 +08:00
pkg Fix cn2an ValueError unhandled. 2025-10-14 17:42:15 +08:00
.gitignore Tidy code 2025-10-11 11:37:09 +08:00
LICENSE License 2025-10-10 18:05:23 +08:00
main.py Tidy code 2025-10-11 11:37:09 +08:00
README.md Tidy code 2025-10-11 11:37:09 +08:00
requirement.txt Add requirements 2025-10-10 18:00:45 +08:00

fictional-fiesta

Run

Init db:

python pkg/exchange_db.py

Run:

python main.py

Potential format

  • 汉字:
    • 人民币伍佰万元整
    • 伍拾亿陆仟万人民币元
    • 陆佰万元人民币
    • 壹仟万元(美元)
    • 叁仟万元(人民币)
    • 壹佰万元
    • 壹亿元整
  • 阿拉伯数字:
    • 人民币1578.2309万元整
    • 人民币元1771215.2万元
    • 人民币294117.6470万
    • 美元2400万元
    • ¥20000万元
    • 5000万元整
    • 2036050.2599万元
    • 47100万元
    • 40418.312万元人民币

escapism procedure

用户设定币种 > 币种检测 > 配置默认币种

币种检测独立于币值解析

币值:首字判断种类(汉字/阿拉伯),汉字使用cn2an,其余自建规则

cn2an看似强壮,但目前只能确认处理纯汉字的效果,对于所谓“智能模式”,其规则过于复杂,难以确认。

Useable exchange-rate API

non-free

non-api (web)

Log

10-10

使用现汇/现钞 买入/卖出 哪个来计算?