mirror of
https://github.com/dedfaf/fictional-fiesta.git
synced 2026-06-05 14:09:17 +00:00
Simple fastapi-server to convert amount strings (in Chinese characters or Arabic numerals) into numbers and automatically perform currency exchange.
- Python 100%
|
|
||
|---|---|---|
| pkg | ||
| .gitignore | ||
| LICENSE | ||
| main.py | ||
| README.md | ||
| requirement.txt | ||
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
-
Free currencyconverterapi http://free.currencyconverterapi.com/api/v5/convert?q=EUR_USD
-
Open Source Exchange Rates API https://openexchangerates.org/signup/free
-
ExchangeRate-API https://www.exchangerate-api.com
-
中国工商银行手机网站结售汇计算器 https://papi.icbc.com.cn/exchanges/Calculators/getLatestExchangeInfo
non-free
non-api (web)
- 中国银行外汇牌价 https://www.boc.cn/sourcedb/whpj/index.html https://www.boc.cn/sourcedb/whpj/sjmfx_1621.html
Log
10-10
使用现汇/现钞 买入/卖出 哪个来计算?