# ritikrikm/generator architecture

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

- Interactive diagram: https://gitdiagram.com/ritikrikm/generator
- Repository: https://github.com/ritikrikm/generator

## Overview

#### Purpose and entry point

This is an offline Python desktop utility that converts Gherkin `.feature` specifications into Excel test-case workbooks. Its executable entry point is `feature_to_excel.py`; users run it locally, choose an input feature file and output `.xlsx` location, then generate the workbook.

#### Conversion engine and UI boundary

`feature_to_excel.py` contains the application’s primary control flow: desktop file selection, feature-text parsing, test-case expansion, and workbook output. The GUI is a local interaction boundary; no server, browser, API, or AI service is involved.

- `feature_to_excel.py`
- `requirements.txt`

#### Feature file as the source contract

Gherkin feature files are the input domain model. Scenarios define reusable test context and steps, while supported fields and example-table columns supply the values that become Excel fields. The full supported mapping contract is documented separately and demonstrated by a canonical template.

- `FEATURE_FIELD_TO_EXCEL_MAPPING.md`
- `feature_to_excel_mapping_template.feature`
- `feature_to_excel_project_template.feature`

#### Scenario-outline expansion

The defining transformation rule is row expansion: every data row in an `Examples` table produces one output Excel test-case row. This makes Examples tables the primary cardinality boundary between feature specifications and workbook records. Multiple Examples/data combinations are represented in the included validation fixture.

- `test_multiple_examples.feature`
- `feature_to_excel.py`

#### Excel workbook generation

The output adapter creates an `.xlsx` workbook with fixed test-management-oriented columns, including identification, labels, language, summary, description, actions, expected results, data, assessment metadata, and repository path. `openpyxl` is the material external runtime dependency used for Excel serialization.

- `feature_to_excel.py`
- `requirements.txt`

#### Input examples and usage patterns

The repository includes representative feature inputs for login, retail opportunity/home-notification workflows, screenshot visibility, and image-derived component cases. These are operational samples for exercising parser behavior and shaping generated test cases, rather than separate application modules.

- `sample_login.feature`
- `retail_home_notification_sample.feature`
- `retailrb_opportunity_components_from_images.feature`

#### Deployment model

The tool is distributed as source and executes directly under Python. It is intentionally local/offline: input is filesystem-based `.feature` text, output is filesystem-based Excel, and its only declared package dependency is `openpyxl`.

- `README.md`
- `feature_to_excel.py`
- `requirements.txt`

Main entry points: [`feature_to_excel.py`](https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py) (Feature parser), [`feature_to_excel_mapping_template.feature`](https://github.com/ritikrikm/generator/blob/main/feature_to_excel_mapping_template.feature) (Mapping template), [`README.md`](https://github.com/ritikrikm/generator/blob/main/README.md) (Usage guide), [`FEATURE_FIELD_TO_EXCEL_MAPPING.md`](https://github.com/ritikrikm/generator/blob/main/FEATURE_FIELD_TO_EXCEL_MAPPING.md) (Field mapping contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Local Converter"]
  node_entry["Python entry point<br/>desktop script"]
  node_file_picker["File selection UI<br/>desktop UI"]
  node_gherkin_parser["Feature parser"]
  node_outline_expander["Scenario expansion<br/>transformation"]
  node_workbook_writer["Workbook writer<br/>Excel adapter"]
  node_readme["Usage guide<br/>documentation<br/>[README.md]"]
end

subgraph group_contracts["Feature Contracts"]
  node_mapping_doc["Field mapping contract<br/>documentation"]
  node_mapping_template["Mapping template<br/>feature template"]
  node_project_template["Project template<br/>feature template"]
  node_examples_fixture["Multiple Examples fixture<br/>validation feature"]
  node_sample_features["Operational samples<br/>feature samples"]
end

subgraph group_io["Filesystem I/O"]
  node_feature_file["Input .feature file<br/>Gherkin source"]
  node_xlsx_file["Output .xlsx workbook<br/>Excel artifact"]
  node_openpyxl["openpyxl<br/>Python dependency<br/>[requirements.txt]"]
end

node_entry -->|"opens"| node_file_picker
node_file_picker -->|"selects"| node_feature_file
node_feature_file -->|"reads"| node_gherkin_parser
node_entry -->|"invokes"| node_gherkin_parser
node_gherkin_parser -->|"scenarios and Examples"| node_outline_expander
node_outline_expander -->|"test-case records"| node_workbook_writer
node_workbook_writer -->|"uses"| node_openpyxl
node_workbook_writer -->|"writes"| node_xlsx_file
node_mapping_doc -.->|"documented by"| node_mapping_template
node_mapping_template -.->|"defines supported input"| node_gherkin_parser
node_project_template -.->|"example input"| node_gherkin_parser
node_examples_fixture -.->|"validates row expansion"| node_outline_expander
node_sample_features -.->|"exercise input behavior"| node_gherkin_parser
node_readme -.->|"runs"| node_entry

click node_entry "https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py"
click node_file_picker "https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py"
click node_gherkin_parser "https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py"
click node_outline_expander "https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py"
click node_workbook_writer "https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py"
click node_openpyxl "https://github.com/ritikrikm/generator/blob/main/requirements.txt"
click node_mapping_doc "https://github.com/ritikrikm/generator/blob/main/FEATURE_FIELD_TO_EXCEL_MAPPING.md"
click node_mapping_template "https://github.com/ritikrikm/generator/blob/main/feature_to_excel_mapping_template.feature"
click node_project_template "https://github.com/ritikrikm/generator/blob/main/feature_to_excel_project_template.feature"
click node_examples_fixture "https://github.com/ritikrikm/generator/blob/main/test_multiple_examples.feature"
click node_sample_features "https://github.com/ritikrikm/generator/blob/main/sample_login.feature"
click node_readme "https://github.com/ritikrikm/generator/blob/main/README.md"

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_entry,node_file_picker,node_gherkin_parser,node_outline_expander,node_workbook_writer,node_readme toneBlue
class node_mapping_doc,node_mapping_template,node_project_template,node_examples_fixture,node_sample_features toneAmber
class node_feature_file,node_xlsx_file,node_openpyxl toneMint
```

## Components

### Local Converter

Offline Python desktop application.

- [Python entry point](https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py): desktop script · Coordinates selection, conversion, and export. · `feature_to_excel.py`
- [File selection UI](https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py): desktop UI · Chooses source feature and destination workbook paths. · `feature_to_excel.py`
- [Feature parser](https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py): parser · Reads scenarios, steps, supported fields, and Examples tables. · `feature_to_excel.py`
- [Scenario expansion](https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py): transformation · Creates one test-case record per Examples data row. · `feature_to_excel.py`
- [Workbook writer](https://github.com/ritikrikm/generator/blob/main/feature_to_excel.py): Excel adapter · Writes fixed test-management columns to XLSX. · `feature_to_excel.py`
- [Usage guide](https://github.com/ritikrikm/generator/blob/main/README.md): documentation · Describes local source distribution and execution. · `README.md`

### Feature Contracts

Gherkin mapping documentation and templates.

- [Field mapping contract](https://github.com/ritikrikm/generator/blob/main/FEATURE_FIELD_TO_EXCEL_MAPPING.md): documentation · Defines supported feature-to-Excel field mapping. · `FEATURE_FIELD_TO_EXCEL_MAPPING.md`
- [Mapping template](https://github.com/ritikrikm/generator/blob/main/feature_to_excel_mapping_template.feature): feature template · Canonical supported-field example. · `feature_to_excel_mapping_template.feature`
- [Project template](https://github.com/ritikrikm/generator/blob/main/feature_to_excel_project_template.feature): feature template · Project-oriented feature example. · `feature_to_excel_project_template.feature`
- [Multiple Examples fixture](https://github.com/ritikrikm/generator/blob/main/test_multiple_examples.feature): validation feature · Demonstrates multiple Examples/data combinations. · `test_multiple_examples.feature`
- [Operational samples](https://github.com/ritikrikm/generator/blob/main/sample_login.feature): feature samples · Representative login, retail, and image-derived cases. · `sample_login.feature`

### Filesystem I/O

Local input and output boundaries.

- **Input .feature file**: Gherkin source · Filesystem feature specification selected by the user.
- **Output .xlsx workbook**: Excel artifact · Generated local test-case workbook.
- [openpyxl](https://github.com/ritikrikm/generator/blob/main/requirements.txt): Python dependency · Serializes workbook output. · `requirements.txt`

## Connections

- Python entry point → File selection UI: opens
- File selection UI → Input .feature file: selects
- Input .feature file → Feature parser: reads
- Python entry point → Feature parser: invokes
- Feature parser → Scenario expansion: scenarios and Examples
- Scenario expansion → Workbook writer: test-case records
- Workbook writer → openpyxl: uses
- Workbook writer → Output .xlsx workbook: writes
- Field mapping contract → Mapping template: documented by
- Mapping template → Feature parser: defines supported input
- Project template → Feature parser: example input
- Multiple Examples fixture → Scenario expansion: validates row expansion
- Operational samples → Feature parser: exercise input behavior
- Usage guide → Python entry point: runs
