> For the complete documentation index, see [llms.txt](https://aryanai.gitbook.io/docs.aryanandarya/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aryanai.gitbook.io/docs.aryanandarya/my-skills/currency-of-india/currency-process-flow.md).

# 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.

{% hint style="info" %}
[pycountry ](https://pypi.org/project/pycountry/)packages provides the ISO databases for the standards for Countries, Languages, Deleted Countries, Subdivisions of Countries, Currencies, Scripts.
{% endhint %}

```python
while i<len(pycountry.countries):
    if subStrCheck(rawspeech,(list(pycountry.countries)[i].name)):
        countryname = list(pycountry.countries)[i].name
        break
    i = i+1
    if i == len(pycountry.countries):
        countryname = "India" 
```

## 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.

```python
countriesattributes = pycountry.countries.get(name=countryname)
countrynumericid = countriesattributes.numeric
```

## 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.

```python
currencyname = pycountry.currencies.get(numeric=countrynumericid).name
currencysymbol = pycountry.currencies.get(numeric=countrynumericid).alpha_3
```

{% hint style="success" %}
Aryan Shares the Currency Name and Symbol for the requested Country and flow is completed successfully. Control is passed to NextStep.

```python
PrintText(aifriend,"Currency for " + countryname + " is " + currencyname + " and symbol is " + currencysymbol )
SpeakText(aifriend,"Currency for " + countryname + " is " + currencyname + " and symbol is " + currencysymbol )
```

{% endhint %}
