Skip to main content

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. Social Image

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

  1. Clone the repository:

    git clone https://codeberg.org/trtmn/nato-phonetic-alphabet.git
    cd nato-phonetic-alphabet
    
  2. Create and activate virtual environment:

    python3.11 -m venv .venv
    source .venv/bin/activate  # On macOS/Linux
    # or
    .venv\Scripts\activate     # On Windows
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. 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 letter
  • spell <word> - Spell out a word using NATO phonetic alphabet
  • interactive - Enter interactive mode for spelling words
  • print - Generate formatted output for printing
  • list - 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. 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

phonetic_nato-0.1.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phonetic_nato-0.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file phonetic_nato-0.1.0.tar.gz.

File metadata

  • Download URL: phonetic_nato-0.1.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for phonetic_nato-0.1.0.tar.gz
Algorithm Hash digest
SHA256 175507d0725084239c784c01ebb19b574da9bbc873b052b3840c5985ce765586
MD5 ff3a9f726e7c56972ddf5460c02ba6b2
BLAKE2b-256 3c259b2f5de923ede9f606902ef0dd67e1750a015825d5d4c0d64101a00d954f

See more details on using hashes here.

File details

Details for the file phonetic_nato-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for phonetic_nato-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cca65ced114b5905459e303064aa0e415d5fbd1e71722395a9fca0fb51131fab
MD5 bb93dbcc224c06a51017b36d54f4b1ca
BLAKE2b-256 69fe94817ea358ddc9187f45cf97e0ca9a6d44ec7b78360302d34dffcf7704ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page