Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔤 NATO Phonetic Alphabet Converter

A simple Python application that converts any word into its corresponding NATO phonetic alphabet representation.

The program reads the NATO phonetic alphabet from a CSV file, creates a dictionary using a dictionary comprehension, and translates user input into phonetic code words.

Features

  • Reads data from a CSV file using Pandas
  • Converts letters into NATO phonetic alphabet code words
  • Uses dictionary comprehensions
  • Handles invalid user input with exception handling
  • Runs continuously until the user exits the program

Technologies

  • Python 3
  • Pandas

Project Structure

nato-phonetic-alphabet/
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
├── main.py
└── nato_phonetic_alphabet.csv

File Overview

  • main.py – loads the CSV file and converts user input into NATO phonetic words
  • nato_phonetic_alphabet.csv – contains the NATO alphabet data

Installation

Clone the repository:

git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
cd YOUR_REPOSITORY

Create a virtual environment:

python -m venv .venv

Activate the virtual environment.

macOS / Linux

source .venv/bin/activate

Windows

.venv\Scripts\activate

Install the required package:

pip install -r requirements.txt

Dependencies

This project requires:

pandas

Example requirements.txt:

pandas

Run the Application

Start the program with:

python main.py

Example:

Enter a word: ChatGPT

['Charlie', 'Hotel', 'Alfa', 'Tango', 'Golf', 'Papa', 'Tango']

Type:

EXIT

to terminate the application.

How It Works

  1. The CSV file is loaded using Pandas.
  2. A dictionary comprehension creates a mapping between letters and NATO code words.
  3. The user enters a word.
  4. Each character is converted into its NATO equivalent.
  5. Invalid characters are handled using exception handling.
  6. The program continues until the user enters EXIT.

Concepts Demonstrated

This project demonstrates several important Python concepts:

  • Reading CSV files with Pandas
  • Dictionary comprehensions
  • List comprehensions
  • Exception handling (try / except)
  • Loops
  • User input
  • Data processing

Example Output

Input:

Python

Output:

['Papa', 'Yankee', 'Tango', 'Hotel', 'Oscar', 'November']

Possible Improvements

  • Ignore numbers and special characters automatically
  • Support complete sentences
  • Save the output to a text file
  • Create a graphical user interface (GUI)
  • Add speech output for the phonetic words
  • Allow multiple phonetic alphabets (ICAO, Morse Code, etc.)

Author

Mick Kuyenda Misamu
MicadenScope

License

This project is licensed under the MIT License.

About

Python application that converts words into the NATO phonetic alphabet using Pandas and dictionary comprehensions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages