Skip to main content

CLI tool for endoflife.date API - Check EOL dates and support lifecycles

Project description

EOL CLI

A powerful command-line interface for the endoflife.date API. Query end-of-life dates and support lifecycles for various products directly from your terminal.

License: MIT Python 3.10+ Tests Coverage

Features

  • ๐Ÿ” Search Products: List and search all products tracked by endoflife.date
  • ๐Ÿ“ฆ Product Details: Get detailed information about specific products
  • ๐Ÿท๏ธ Categories & Tags: Filter products by categories and tags
  • ๐Ÿ”– Identifiers: Query products by CPE, PURL, and other identifiers
  • ๐Ÿ“Š Rich Output: Beautiful terminal output with tables and colors
  • ๐Ÿ’พ JSON Export: Export data in JSON format for further processing
  • ๐Ÿš€ Fast & Modular: Built with Click and designed for extensibility

Installation

From PyPI (recommended)

pip install eol-cli

From Source

git clone https://github.com/seifreed/eol-cli.git
cd eol-cli
pip install -e .

Development Installation

git clone https://github.com/seifreed/eol-cli.git
cd eol-cli
pip install -e ".[dev]"

Quick Start

# List all available products
eol-cli products list

# Get details about a specific product
eol-cli products get ubuntu

# Get latest release information
eol-cli products release ubuntu latest

# List products by category
eol-cli categories get os

# Search products by tag
eol-cli tags get linux

# Export data as JSON
eol-cli products get ubuntu --json

Usage

Products

# List all products
eol-cli products list

# List all products with full details
eol-cli products list --full

# Get a specific product (shows only releases table by default)
eol-cli products get <product-name>

# Get multiple products (comma-separated)
eol-cli products get <product1>,<product2>,<product3>

# Get all product details (info, links, identifiers, releases)
eol-cli products get <product-name> --all

# Get a specific release cycle
eol-cli products release <product-name> <release-cycle>

# Get the latest release cycle
eol-cli products release <product-name> latest

# Export as JSON
eol-cli products get ubuntu --json

Categories

# List all categories
eol-cli categories list

# Get products in a category
eol-cli categories get <category-name>

Tags

# List all tags
eol-cli tags list

# Get products with a specific tag
eol-cli tags get <tag-name>

Identifiers

# List all identifier types
eol-cli identifiers list

# Get identifiers by type
eol-cli identifiers get <identifier-type>

API Information

# Get API index
eol-cli index

Output Formats

Rich Terminal Output (Default)

By default, the CLI uses Rich to display beautiful, formatted output in your terminal with:

  • Color-coded information
  • Formatted tables
  • Pretty-printed data structures

JSON Output

Use the --json flag to get machine-readable JSON output:

eol-cli products get ubuntu --json

This is useful for:

  • Piping to other tools (jq, etc.)
  • Scripting and automation
  • Integration with other systems

Examples

Check if Ubuntu 20.04 is EOL

eol-cli products release ubuntu 20.04

Find all Linux distributions

eol-cli tags get linux

Export all products data

eol-cli products list --full --json > products.json

Check Python versions

eol-cli products get python

Compare Multiple Products

# Check multiple products at once
eol-cli products get python,nodejs,ruby

# Export multiple products to JSON
eol-cli products get ubuntu,debian,alpine-linux --json > linux_distros.json

# Compare with XML output
eol-cli products get apache,nginx --xml

Configuration

The CLI uses sensible defaults and requires no configuration. It connects to:

  • API Base URL: https://endoflife.date/api/v1

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/seifreed/eol-cli.git
cd eol-cli

# Create virtual environment (Python 3.14 recommended)
python3.14 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode with dev dependencies
pip install -e ".[dev]"

Running Tests

The project includes comprehensive unit tests with 99% code coverage (176 tests, all using real API calls):

# Run all tests
pytest

# Run with coverage report
pytest --cov=eol_cli --cov-report=term-missing

# Run with HTML coverage report
pytest --cov=eol_cli --cov-report=html
# Open htmlcov/index.html in your browser

# Run specific test files
pytest tests/test_api_client.py
pytest tests/test_cli_commands.py
pytest tests/test_formatters.py

# Run tests in parallel (faster)
pytest -n auto

Test Structure

  • test_api_client.py: Tests for API client functionality (26 tests)
  • test_cli_commands.py: Tests for CLI commands (47 tests)
  • test_formatters.py: Tests for JSON, XML, and Rich formatters (27 tests)
  • test_command_error_handling.py: Tests for error handling and validation (27 tests)
  • test_edge_cases.py: Tests for edge cases and complex scenarios (26 tests)
  • test_rich_formatter_edge_cases.py: Tests for Rich formatter edge cases (30 tests)

All tests use real API calls to endoflife.date (no mocks or fake data) to ensure accurate behavior.

Code Formatting

# Format code with Black
black eol_cli/

# Lint with Ruff
ruff check eol_cli/

Project Structure

eol-cli/
โ”œโ”€โ”€ eol_cli/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py              # Main CLI entry point
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ client.py       # API client
โ”‚   โ”œโ”€โ”€ commands/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ products.py     # Product commands
โ”‚   โ”‚   โ”œโ”€โ”€ categories.py   # Category commands
โ”‚   โ”‚   โ”œโ”€โ”€ tags.py         # Tag commands
โ”‚   โ”‚   โ”œโ”€โ”€ identifiers.py  # Identifier commands
โ”‚   โ”‚   โ””โ”€โ”€ index.py        # Index command
โ”‚   โ””โ”€โ”€ formatters/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ json_formatter.py   # JSON output
โ”‚       โ””โ”€โ”€ rich_formatter.py   # Rich terminal output
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ eol-cli.py              # Wrapper script
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ setup.py
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ .gitignore

Testing

The project maintains a 99.83% code coverage with comprehensive testing:

Test Statistics

  • 176 tests - All passing โœ…
  • 99.83% code coverage (592/593 lines)
  • Real API calls - No mocks or fake data
  • 2,075 lines of test code

Test Suite Overview

Test File Tests Description
test_api_client.py 26 API client functionality and error handling
test_cli_commands.py 47 CLI command execution and validation
test_formatters.py 27 JSON, XML, and Rich output formatters
test_command_error_handling.py 27 Error handling and exception paths
test_edge_cases.py 26 Edge cases and complex scenarios
test_rich_formatter_edge_cases.py 30 Rich formatter edge cases

Running Tests

# Run all tests
pytest

# Run with coverage report
pytest --cov=eol_cli --cov-report=term-missing

# Run with HTML coverage report
pytest --cov=eol_cli --cov-report=html
# Open htmlcov/index.html in your browser

# Run specific test file
pytest tests/test_api_client.py

For detailed testing documentation, see TESTING.md.

API Coverage

This CLI covers all endpoints from the endoflife.date API v1.2.0:

  • โœ… Index (/)
  • โœ… Products (/products, /products/full, /products/{product})
  • โœ… Product Releases (/products/{product}/releases/{release}, /products/{product}/releases/latest)
  • โœ… Categories (/categories, /categories/{category})
  • โœ… Tags (/tags, /tags/{tag})
  • โœ… Identifiers (/identifiers, /identifiers/{type})

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Marc Rivero (@seifreed)

Support

If you find this project useful, consider supporting its development:

Buy Me A Coffee

Your support helps maintain and improve this project! โ˜•

Acknowledgments

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

eol_cli-0.1.0.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

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

eol_cli-0.1.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eol_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for eol_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf244875134f49ae7ff4806cf4510187e3de623615f8e7664a2914f86670845a
MD5 062617e08195d0157220e4e69c9389b4
BLAKE2b-256 b0df86e4d34c3fd99a9bf5f668e18c589a046a8aa1f8d99507ed3c413f34c6b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eol_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for eol_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 965c44d05e32f53204862f9e427962dd0a23068754f68c8989a06d82d84a1de6
MD5 7df352d71cbe9550e21679a5197a7e44
BLAKE2b-256 f02344111c58425e13b4bb74439930e64cb2e4888370e97e3e1d1c33eb2ca672

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