A beautiful CLI for the NATO phonetic alphabet built with Python, Click, and Rich
Project description
nato-phonetic-alphabet
Printable / Remixable Nato Phonetic Alphabet page with a beautiful command-line interface.
Project page is hosted at https://trtmn.io/nato-phonetic-alphabet
Command Line Interface
A beautiful and easy-to-use CLI built with Python 3.11, Click, and Rich for displaying and working with the NATO phonetic alphabet.
Features
- 🎨 Beautiful Output: Rich terminal formatting with colors and styling
- 🔍 Search & Lookup: Find phonetic equivalents for letters and words
- 📝 Interactive Mode: Spell out words interactively
- 🖨️ Printable Output: Generate formatted output for printing
- 🚀 Fast & Lightweight: Built with modern Python libraries
Installation
Prerequisites
- Python 3.11 or higher
- pip (Python package installer)
Setup
-
Clone the repository:
git clone https://codeberg.org/trtmn/nato-phonetic-alphabet.git cd nato-phonetic-alphabet
-
Create and activate virtual environment:
python3.11 -m venv .venv source .venv/bin/activate # On macOS/Linux # or .venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Install the CLI:
pip install -e .
Usage
Basic Commands
Display the full NATO phonetic alphabet:
phonetic
Look up a specific letter:
phonetic lookup A
Spell out a word:
phonetic spell "HELLO"
Interactive spelling mode:
phonetic interactive
Generate printable output:
phonetic print --output nato-alphabet.txt
Command Options
phonetic --help
Available commands:
lookup <letter>- Find phonetic equivalent for a single letterspell <word>- Spell out a word using NATO phonetic alphabetinteractive- Enter interactive mode for spelling wordsprint- Generate formatted output for printinglist- Display the complete NATO phonetic alphabet
Examples
# Look up a letter
phonetic lookup X
# Output: X - X-ray
# Spell a word
phonetic spell "WORLD"
# Output: W - Whiskey, O - Oscar, R - Romeo, L - Lima, D - Delta
# Interactive mode
phonetic interactive
# Enter words to spell them out interactively
Development
Project Structure
nato-phonetic-alphabet/
├── .venv/ # Virtual environment
├── src/ # Source code
│ └── nato_phonetic/ # Main package
├── tests/ # Test files
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
└── README.md # This file
Running Tests
pytest tests/
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
Dependencies
- Click: Command-line interface creation kit
- Rich: Rich text and beautiful formatting in the terminal
- Python 3.11+: Modern Python features and performance
License
This project is open source. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phonetic_nato-0.2.0.tar.gz.
File metadata
- Download URL: phonetic_nato-0.2.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc4f0f64872a55863d4c51046d88d58b2509a0201822d059a120ac27deb790b7
|
|
| MD5 |
2cc16f4ec25f89551c5a624aed2c8bb1
|
|
| BLAKE2b-256 |
0568b85ddf17c923544eaa63e458e12cd84a43901189776ac073dbbbc13e5437
|
File details
Details for the file phonetic_nato-0.2.0-py3-none-any.whl.
File metadata
- Download URL: phonetic_nato-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0d363dddff08ef7e6a3cb95c07d8ce3504eeb7f477d5d797d803d343c10f1b7
|
|
| MD5 |
a101fcafdd40a4019d705ad3d4bf30e9
|
|
| BLAKE2b-256 |
ac96d4d0afba2101017347fdcb1160e31d7227f98856792eb294c59e4a8f7a2b
|