Currency Process Flow
Identify the Country Name
getCurrency flow is used to get the Currency of a Country. Once getCurrency flow is invoked, Rawspeech is passed to the getCurrency flow to identify the Country Name.
getCountryName parses the RawSpeech against the list of country from pycountry and return the country name identified.
In case the country is not identified then default country name is returned.
This is for questions such as what is capital?, So no country is passed thus it default's the country and returns India in this example.
pycountry packages provides the ISO databases for the standards for Countries, Languages, Deleted Countries, Subdivisions of Countries, Currencies, Scripts.
Identify the Numeric Id for the Country Name
Once the country name is identified then pycountry package is used to get the numeric id of a Country.
Numeric Id will be used as lookup to get the currencies for a country.
Identify the Currency for the Given Numeric ID
Currency Name and Currency Symbol are identified using pycountry.currencies by passing the country numeric id identified in previous step.
Attribute name provides the name of the currency and alpha_3 gives the currency symbol.
Aryan Shares the Currency Name and Symbol for the requested Country and flow is completed successfully. Control is passed to NextStep.
Last updated
Was this helpful?