Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 2.05 KB

File metadata and controls

76 lines (54 loc) · 2.05 KB

httpstatus-cli

A small, dependency-free command-line tool for looking up HTTP status codes offline — no network calls, just a built-in table of the standard codes and their meanings.

Why

Googling "what is HTTP 429" every time is slower than a local lookup, and not always available anyway (airplane, CI sandbox, flaky network). This gives you a man-page-style answer instantly, plus keyword search when you remember what a code does but not its number.

Install

pip install .

This installs an httpstatus-cli command on your PATH.

Usage

$ httpstatus-cli 404
404 Not Found — the server can't find the requested resource

$ httpstatus-cli 429
429 Too Many Requests — the user has sent too many requests in a given amount of time

Search by keyword instead of number:

$ httpstatus-cli --search "not found"
404 Not Found

$ httpstatus-cli --search redirect
301 Moved Permanently
302 Found
307 Temporary Redirect
308 Permanent Redirect

Options

Argument Description
code HTTP status code to look up, e.g. 404
--search KEYWORD Search status codes by name or description

Coverage

All standard codes from the 1xx–5xx ranges defined by RFC 7231, 7233, 7235, 6585, 4918 (WebDAV), 8297 (Early Hints), and related RFCs — roughly 60 codes in total, from 100 Continue through 511 Network Authentication Required.

Exit codes

  • 0 — a matching code (or at least one search match) was found
  • 1 — the code isn't in the built-in table, or no search matches were found
  • 2 — invalid arguments (no code/keyword given, or both given at once)

Development

pip install -e .
python -m unittest discover -s tests -v

License

All rights reserved. This code is public for viewing and reference only — no license is granted to use, copy, modify, or redistribute it. See LICENSE for details.