Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MAMOW

Markdown To M-Rows

MAMOW is a multi-format CLI tool for converting test cases between Markdown, Gherkin, and Excel formats. Designed for QA engineers and test automation developers, it streamlines the process of converting human-readable test specifications into structured formats with automatic tag classification.

Key Features:

  • ๐Ÿ”„ Multi-format conversion: Gherkin โ†” Markdown โ†” Excel
  • ๐Ÿท๏ธ Automatic tag classification: 5 standardized metadata categories
  • ๐Ÿ“ Directory processing: Batch, merge, and single file modes
  • ๐ŸŽจ Beautiful CLI: Colorful interface with progress indicators
  • ๐Ÿ“‹ Hierarchical help: Context-aware help system

๐Ÿ“‘ Quick Navigation

๐Ÿ“‹ Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Python 3.9+ (Check with python3 --version or python --version)
  • Git (Check with git --version)
  • pip (Python package installer)

๐Ÿš€ Getting Started

1. Clone the Repository

Clone the project from the very beginning using the following command:

git clone https://github.com/hanifrazin/MAMOW.git
cd MAMOW

2. Install the CLI Command

MAMOW provides two ways to run the tool:

Method Command Best for
Global CLI (recommended) mamow -i <input> After installation, use from anywhere
Direct Python python src/main.py -i <input> Quick testing, no install needed

The installation scripts below make the mamow command available globally. They handle everything โ€” including virtual environment creation and dependency installation โ€” automatically on the first run.


๐ŸŽ macOS & ๐Ÿง Linux

Option A โ€” Quick Install (Recommended):

Run the installation script from the project root. This copies a launcher into /usr/local/bin:

chmod +x src/executable_scripts/install.sh
./src/executable_scripts/install.sh

Option B โ€” Manual PATH Setup (no sudo needed):

If you don't have sudo access, add the scripts folder to your shell profile instead:

echo 'export PATH="$PATH:'"$(pwd)"'/src/executable_scripts"' >> ~/.zshrc
source ~/.zshrc

How it works: The mamow bash script resolves its real path, creates a .venv virtual environment with all dependencies on first run, then executes src/main.py with your arguments.


๐ŸชŸ Windows

Run the installation batch script in Command Prompt (or PowerShell). This adds the src\executable_scripts folder to your user PATH:

.\src\executable_scripts\install.bat

After installation, restart your terminal for the PATH changes to take effect.

How it works: The mamow.bat script creates a .venv and installs dependencies on first run. It also attempts to build a standalone mamow.exe via PyInstaller for faster subsequent launches. If PyInstaller is not available, it falls back gracefully to running via Python.


๐Ÿ’ก First-run behavior: When you run mamow for the first time (on any platform), it will automatically:

  1. Create a Python virtual environment (.venv/) in the project root
  2. Install all required dependencies (pydantic, openpyxl, rich)
  3. Execute your command โ€” no manual pip install needed

๐Ÿ“– How to Use

MAMOW is a multi-format test case converter with two main operation modes:

1. Legacy Mode: Markdown โ†’ Excel Conversion

For converting Markdown test cases to Excel spreadsheets with advanced directory processing.

2. Convert Mode: Multi-Format Conversion

For converting between Gherkin, Markdown, and Excel formats with automatic tag classification.

๐ŸŽฏ Getting Help

MAMOW features a hierarchical help system to make it easy to find the right information:

# Show main overview with all commands
mamow

# Show help for Markdown โ†’ Excel conversion
mamow --help

# Show help for format conversion (Gherkin โ†” Markdown โ†” Excel)
mamow convert --help

๐Ÿ“ Legacy Mode: Markdown โ†’ Excel

Convert Markdown test cases to Excel spreadsheets with directory processing capabilities.

Basic Usage:

mamow -i <input_path> [-o <output_path>] [-c <config_path>] [--merge | --single]

Using Python directly:

python src/main.py -i <input_path> [-o <output_path>] [-c <config_path>] [--merge | --single]

Arguments:

Option Description Default
-i, --input (Required) Path to input Markdown file (.md) or a directory containing .md files โ€”
-o, --output Path to output Excel file (.xlsx) or directory Value fromconfig.json
-c, --config Path to configuration file config.json
--merge Mergeall .md files in a directory into a single .xlsx file off
--single Exporteach .md file in a directory to separate .xlsx files off
-h, --help Show help message with all options and examples โ€”

๐Ÿ”„ Convert Mode: Multi-Format Conversion

Convert between Gherkin, Markdown, and Excel formats with automatic tag classification.

Basic Usage:

mamow convert -i <input_file> -f <format> [-o <output_file>]

Format Options:

  • md - Markdown file (.md)
  • gherkin - Gherkin/Feature file (.feature)
  • feature - Alias for gherkin
  • excel - Excel spreadsheet (.xlsx)

Automatic Tag Classification

When converting between Gherkin and Markdown, MAMOW automatically classifies tags into 5 standardized metadata blocks:

  1. Priority - Uppercase, comma-separated (e.g., P1, P2)
  2. TC Type - Capitalized (e.g., Positive, Negative)
  3. Test Type - Lowercase (e.g., smoke, regression)
  4. Platform Type - Uppercase, comma-separated (e.g., UI, MOBILE)
  5. Other Tags - Lowercase, comma-separated (e.g., login, bug-123)

Processing Modes (Legacy Mode Only)

When the input is a directory in Legacy Mode, MAMOW supports three modes:

Mode Flag Behavior
Batch (default) (no flag) Processes each.md file individually โ†’ separate .xlsx files
Merge --merge Combines all.md files into one .xlsx file
Single --single Exports each.md file to its own .xlsx file with conflict-safe naming

Note: --merge and --single cannot be used together. If the input is a single file, both flags are ignored.

Output Naming Convention

When the output path is a directory, MAMOW auto-generates filenames as follows:

Mode Output Filename Pattern Example
Single file {filename}.xlsx login.xlsx
Batch (directory) {filename}.xlsx per file login.xlsx, register.xlsx
Merge (directory) {input_folder}_merge.xlsx data_merge.xlsx
Single (directory) {filename}_single.xlsx (appends _1, _2, โ€ฆ on conflict) login_single.xlsx

Auto-created Result Subfolder

When the input is a directory, MAMOW automatically creates a result_<input_folder_name> subfolder inside the output directory to keep your exports organized. For example:

mamow -i samples/data/ -o samples/output/ --merge

โ†’ Exports to samples/output/result_data/data_merge.xlsx

This prevents output clutter and keeps results from different input directories separated.

๐Ÿ“‹ Examples

Legacy Mode Examples (Markdown โ†’ Excel)

1. Process a single Markdown file:

mamow -i samples/data/login.md -o samples/output/login.xlsx

2. Batch process all files in a directory (default mode):

mamow -i samples/data/ -o samples/output/

โ†’ Each .md file becomes its own .xlsx inside samples/output/result_data/

3. Merge all files in a directory into a single Excel workbook:

mamow -i samples/data/ -o samples/output/data.xlsx --merge

โ†’ All test cases combined into samples/output/result_data/data_merge.xlsx

4. Export each file separately using --single mode:

mamow -i samples/data/ -o samples/output/ --single

โ†’ Each .md โ†’ separate .xlsx (e.g., login_single.xlsx, login-2_single.xlsx) inside samples/output/result_data/

5. Run using fallback default paths (as defined in config.json):

mamow -i login.md

โ†’ Looks for samples/input/login.md and outputs to samples/output/

Convert Mode Examples (Multi-Format)

1. Markdown โ†’ Gherkin with tag classification:

mamow convert -i test.md -f gherkin -o test.feature

โ†’ Converts Markdown to Gherkin with tags automatically classified

2. Gherkin โ†’ Markdown:

mamow convert -i test.feature -f md -o test.md

โ†’ Converts Gherkin to Markdown with proper tag formatting

3. Markdown โ†’ Excel (via convert mode):

mamow convert -i test.md -f excel -o test.xlsx

4. Gherkin โ†’ Excel:

mamow convert -i test.feature -f excel -o test.xlsx

5. Auto-generated output naming:

mamow convert -i input.feature -f md

โ†’ Creates input.md in the same directory

๐ŸŽจ CLI Interface

MAMOW features a beautiful, colorful CLI interface:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                      โ”‚
โ”‚        __  __    _    __  __  _____        __        โ”‚
โ”‚       |  \/  |  / \  |  \/  |/ _ \ \      / /        โ”‚
โ”‚       | |\/| | / _ \ | |\/| | | | \ \ /\ / /         โ”‚
โ”‚       | |  | |/ ___ \| |  | | |_| |\ V  V /          โ”‚
โ”‚       |_|  |_/_/   \_\_|  |_|\___/  \_/\_/           โ”‚
โ”‚                                                      โ”‚
โ”‚                Markdown To M-Rows                    โ”‚
โ”‚                                                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

The interface provides:

  • Colorful output with clear visual hierarchy
  • Progress bars for long operations
  • Well-formatted tables and panels
  • Intuitive help system with examples

๐Ÿท๏ธ Tag Classification & Gherkin Support

Automatic Tag Classification

MAMOW automatically classifies Gherkin tags into 5 standardized metadata blocks when converting to/from Markdown:

Example Gherkin tags:

@P1 @Negative @UI @smoke @login @bug-123

Becomes in Markdown:

**Priority**: P1
**TC Type**: Negative
**Test Type**: smoke
**Platform Type**: UI
**Other Tags**: login, bug-123

Supported Tag Categories

Category Format Example Tags
Priority Uppercase, comma-separated P1, P2, P3, P4, P5
TC Type Capitalized Positive, Negative
Test Type Lowercase smoke, regression, sanity, integration
Platform Type Uppercase UI, MOBILE, API, WEB, DESKTOP
Other Tags Lowercase login, logout, bug-123, edge-case

Gherkin Syntax Support

  • Feature files: .feature extension
  • Scenario tags: Tags before each scenario
  • Feature tags: Tags at the feature level
  • Roundtrip preservation: All tags preserved through conversions

Sample Gherkin File

@P1 @smoke @UI
Feature: Login Module
  As a user I want to login to the system
  
  @Negative @MOBILE
  Scenario: Invalid login on mobile
    Given I am on mobile login page
    When I enter wrong credentials
    Then error message is displayed

๐Ÿ›  Troubleshooting

Here are some common issues you might encounter and how to fix them:

1. "Command not found: python3" or "python3 is not recognized"

  • Solution: Ensure Python is added to your system's PATH during installation. On Windows, you might need to use python instead of python3.

2. Virtual environment activation fails (source venv/bin/activate)

  • Solution (macOS/Linux): Ensure you created the venv with the exact name venv. Check your current directory is the project root.
  • Solution (Windows): If you receive a script execution policy error in PowerShell, run Set-ExecutionPolicy Unrestricted -Scope CurrentUser as an Administrator, or use Command Prompt to run venv\Scripts\activate.bat.

3. ModuleNotFoundError: No module named 'pydantic' (or openpyxl)

  • Solution: This means the dependencies are not installed or your virtual environment is not active. Make sure you activate the virtual environment (source venv/bin/activate) and run pip install -r requirements.txt again.

4. Error: Input path '...' does not exist when running the CLI

  • Solution: Verify the path to your Markdown file is correct relative to your current terminal working directory. You can also provide an absolute path to the file.

5. mamow command not found or does not execute

If you try to run mamow and get an error, ensure you have run the installation script first (install.sh for Mac/Linux, install.bat for Windows). If issues persist, follow these manual fixes:

๐ŸŽ macOS & ๐Ÿง Linux:

  • Issue A: Permission Denied The scripts need execution permissions. Fix: Run the following command from the project root:

    chmod +x src/executable_scripts/mamow
    chmod +x src/executable_scripts/install.sh
  • Issue B: Command not found (mamow: command not found) The install.sh might have failed to write to /usr/local/bin due to permission issues or restricted environments. Fix 1 (Manual Symlink):

    sudo ln -s "$(pwd)/src/executable_scripts/mamow" /usr/local/bin/mamow

    Fix 2 (Add to PATH): Add the folder to your ~/.zshrc or ~/.bashrc.

    echo 'export PATH="$PATH:'"$(pwd)"'/src/executable_scripts"' >> ~/.zshrc
    source ~/.zshrc

๐ŸชŸ Windows:

If you ran install.bat but mamow still isn't recognized in PowerShell or Command Prompt:

  • Issue: PATH environment variable didn't refresh Fix: Restart your PowerShell or Command Prompt window. The PATH changes applied by install.bat take effect in new terminal sessions.

  • Issue: Script Execution Disabled (PowerShell) Fix: Open PowerShell as Administrator and run:

    Set-ExecutionPolicy Unrestricted -Scope CurrentUser
  • Alternative for Git Bash Users: If you prefer Git Bash instead of PowerShell, Git Bash reads the bash mamow file instead of mamow.bat. You can alias it by running:

    echo "alias mamow='bash $(pwd)/src/executable_scripts/mamow'" >> ~/.bash_profile
    source ~/.bash_profile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages