# ai4bharat/indic-numtowords architecture

> Architecture diagram of the GitHub repository ai4bharat/indic-numtowords, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ai4bharat/indic-numtowords
- Repository: https://github.com/ai4bharat/indic-numtowords

## Overview

AI4Bharat num2words is a Python library that turns non-negative integers into words for English and Indian languages. Callers pass a number, language code, and optional variation or digit-splitting flags to `num2words`; the central module selects the language-specific conversion path and returns text or alternatives. Language modules use their own number-word data and, where applicable, utilities. The README documents all supported languages and both optional modes; unsampled implementation details are represented only at their enclosing package paths.

Main entry points: [`indic_numtowords/numtowords.py`](https://github.com/ai4bharat/indic-numtowords/blob/master/indic_numtowords/numtowords.py) (num2words API), [`indic_numtowords`](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords) (Standard converters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Public interface"]
  node_api["num2words API<br/>[numtowords.py]"]
  node_result["Words or variations"]
end

subgraph group_cardinal["Cardinal conversion"]
  node_standard["Standard converters"]
end

subgraph group_extended["Extended languages"]
  node_extended_convert["Extended converters"]
end

subgraph group_language_data["Language resources"]
  node_standard_data["Standard number data"]
  node_standard_utils["Language utilities"]
  node_extended_data["Extended number data"]
  node_extended_utils["Extended utilities"]
end

node_caller(("Library caller"))

node_caller -->|"calls"| node_api
node_api -->|"dispatches"| node_standard
node_api -->|"dispatches"| node_extended_convert
node_standard -->|"reads"| node_standard_data
node_standard -->|"calls"| node_standard_utils
node_extended_convert -->|"reads"| node_extended_data
node_extended_convert -->|"calls"| node_extended_utils
node_api -->|"returns"| node_result

click node_api "https://github.com/ai4bharat/indic-numtowords/blob/master/indic_numtowords/numtowords.py"
click node_standard "https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords"
click node_standard_data "https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords"
click node_standard_utils "https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords"
click node_extended_convert "https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords"
click node_extended_data "https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords"
click node_extended_utils "https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_result toneBlue
class node_standard toneAmber
class node_extended_convert toneMint
class node_standard_data,node_standard_utils,node_extended_data,node_extended_utils toneRose
class node_caller toneIndigo
```

## Components

### Public interface

- [num2words API](https://github.com/ai4bharat/indic-numtowords/blob/master/indic_numtowords/numtowords.py): `indic_numtowords/numtowords.py`
- **Words or variations**

### Cardinal conversion

- [Standard converters](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords): `indic_numtowords`

### Extended languages

- [Extended converters](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords): `indic_numtowords`

### Language resources

- [Standard number data](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords): `indic_numtowords`
- [Language utilities](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords): `indic_numtowords`
- [Extended number data](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords): `indic_numtowords`
- [Extended utilities](https://github.com/ai4bharat/indic-numtowords/tree/master/indic_numtowords): `indic_numtowords`

### Other components

- **Library caller**

## Connections

- Library caller → num2words API: calls
- num2words API → Standard converters: dispatches
- num2words API → Extended converters: dispatches
- Standard converters → Standard number data: reads
- Standard converters → Language utilities: calls
- Extended converters → Extended number data: reads
- Extended converters → Extended utilities: calls
- num2words API → Words or variations: returns
