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

Option 1: uv / uvx (Recommended)

Try it once without installing:

uvx phonetic-nato

Install it as a persistent CLI:

uv tool install phonetic-nato

Don't have uv yet? See the uv install guide (one-line installer for macOS, Linux, and Windows).

Option 2: pip

pip install phonetic-nato

From source (development)

git clone https://codeberg.org/trtmn/nato-phonetic-alphabet.git
cd nato-phonetic-alphabet
uv sync --dev
uv run phonetic --help

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
  • open [slug] - Download (or reuse) a printable asset and open it with the OS default handler. Default slug is the portrait PDF.
  • download [slug] - Download a printable asset to ~/Downloads (use --list to see slugs, -o for a custom directory, --force to re-download)

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

Printable assets

The project ships printable PDFs, an EPub, Word/ODT documents, and Apple Pages sources alongside the source on Codeberg. The CLI can grab any of them straight to your Downloads folder.

# Open the portrait PDF (downloads to ~/Downloads, then opens in your default viewer)
phonetic open

# Other printable variants
phonetic open pdf-landscape
phonetic open epub

# Download without opening
phonetic download docx
phonetic download odt -o ~/Documents/nato/

# See every available asset
phonetic download --list

# Re-download a stale copy
phonetic open --force

Available slugs: pdf, pdf-landscape, epub, docx, odt, pages, pages-landscape.

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.4.0.tar.gz (23.4 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.4.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phonetic_nato-0.4.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for phonetic_nato-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4f8399edac70d2512d30304cc97b09a5d9b8b1cbac09281ecd50d723909d2fce
MD5 0161bed19916a898de1e84a7a2113897
BLAKE2b-256 25d9c72a10491b2bf40d14d727f3061c817f1acc0c3ac1a4d60383515bd99162

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phonetic_nato-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for phonetic_nato-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff4cb0e108326acd04c51e1efe5662ec60d97ad2b818dd56f39cc48690d78ef0
MD5 a488771544d355e018d3027d5106e0a3
BLAKE2b-256 16b7f1a87ff108eb39e9fabbf9f29de43cf6216a18b5e2530e71d472e30345e4

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