是否有一个软件包可以维护带有符号的所有货币的清单? [英] Is there a package that maintains a list all currencies with symbols?
问题描述
是否有一个python软件包,提供了所有(或相当完整的)货币带有符号的列表(例如"$"表示美元).
Is there a python package that provides list of all (or fairly complete) currencies with the symbols (like "$" for USD).
有出色的pycountry, py-moneyed 和
There are excellent pycountry, py-moneyed and ccy but these do not have symbols.
推荐答案
比您真正需要的要多得多,但 Babel 在Locale currency_symbols词典中确实包含货币.不过,有些可能需要一些解析.例如,美元是美元",而不仅仅是美元符号,而其他货币(例如欧元或人民币)则没有这样的前缀.
It's a lot more than you really need, but Babel does include currencies, in the Locale currency_symbols dictionary. Some may require a little parsing, though; for example, USD is 'US$' rather than just the dollar sign, while others, like the Euro or Yuan, have no such prefix.
我相信Babel使用 CLDR 作为其来源.
I believe Babel uses the CLDR as its source.
这篇关于是否有一个软件包可以维护带有符号的所有货币的清单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!