Command-line interface for the `random` module

For reference, this was from 2016 (for 3.6): hashlib command line interface · Issue #70675 · python/cpython · GitHub

Since then, @guido has expressed support for the re CLI proposal as recently as this August: Command line interface for the `re` module

And since 2016, we’ve added a number of CLIs, at least:

3.8

asyncio:

3.9

ast:

3.12

uuid:

sqlite3:

This last one proposed by @rhettinger:

To facilitate rapid experimentation with SQL queries, add a shell to run commands and display results. Attached is minimal proof-of-concept modeled loosely on the Linux sqlite3 REPL. […]

Indeed, python -m sqlite3 is useful for when you don’t have sqlite3 CLI installed.

Similarly, I find having these simple CLIs within arm’s reach for occasional use very helpful; yes, it is possible to write your own scripts or sometimes install third-party tools (which as we’ve seen above, are often non-uniformly available across operating systems), but they’re no longer at your fingertips.

3 Likes