Skip to content

Add a page to the documentation listing stdlib modules with a command-line interface (CLI) #109435

Closed
@vstinner

Description

@vstinner

While reviewing PR #109152, I discover that the sqlite3 module has a command line interface. Maybe I knew and then I forgot.

Is there a a documentation page listing all modules with a command-line interface (CLI)? I don't know so.

By searching for main( pattern and for __main__.py files, so far, I found:

Some modules include self-tests in their main() function. I dislike that and I would suggest to remove it and at least move it to their test suite.

  • ctypes.util: self-test
  • ctypes.textpad: demo
  • curses.has_key: self-test?
  • dbm.__init__: get the DB type... but this CLI is not easy discoverable, it's in the init module!
  • getopt: self-test
  • heapq: self-test
  • shlex: print tokens. Is it really useful?
  • imaplib: self-test, "test the IMAP4_stream class"
  • modulefinder: self-test
  • netrc: just parse ~/.netrc if available, and then display nothing... not very useful
  • random: benchmark
  • smtplib: "Test the sendmail method", try to send an email to localhost SMTP server.
  • symtable: self-test. parse itself (symtable.py)
  • turtle: it's a demo. Looks more like an easter egg or advanced example than "an useful CLI".
  • textwrap: self-test
  • tkinter: self-test
  • wsgiref.simple_server: self-test, run a server, open itself in a browser, stop the server.
  • xml.sax.expatreader: Sheakspear easter egg.
  • xml.sax.xmlreader: self-test.
  • xmlrpc.client + xmlrpc.server: simple demo.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions