Closed
Description
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:
- ast: https://docs.python.org/dev/library/ast.html#command-line-usage
- asyncio: https://docs.python.org/dev/library/asyncio.html just one sentence, "You can experiment with an asyncio concurrent context in the REPL".
- base64: shhh, it's a secret, it's not documented!
- calendar: https://docs.python.org/dev/library/calendar.html#command-line-usage
- compileall: https://docs.python.org/dev/library/compileall.html#command-line-use
- ensurepip: https://docs.python.org/dev/library/ensurepip.html#command-line-interface
- gzip: https://docs.python.org/dev/library/gzip.html#command-line-interface
- idlelib: not sure if it's the same as: https://docs.python.org/dev/library/idle.html#command-line-usage
- json.tool: https://docs.python.org/dev/library/json.html#module-json.tool
- pdb: https://docs.python.org/3/library/pdb.html
- profile: https://docs.python.org/dev/library/profile.html#instant-user-s-manual
- py_compile: https://docs.python.org/dev/library/py_compile.html#command-line-interface
- quopri: (missing)
- site: https://docs.python.org/dev/library/site.html#command-line-interface
- sqlite3 https://docs.python.org/3/library/sqlite3.html#command-line-interface
- tabnanny: https://docs.python.org/dev/library/tabnanny.html
- tarfile: https://docs.python.org/dev/library/tarfile.html#command-line-interface
- timeit: https://docs.python.org/dev/library/timeit.html#command-line-interface
- tokenize: https://docs.python.org/dev/library/tokenize.html#command-line-usage
- trace: https://docs.python.org/dev/library/trace.html#command-line-usage
- turtledemo: https://docs.python.org/3/library/turtle.html#module-turtledemo
- uuid: https://docs.python.org/dev/library/uuid.html#command-line-example
- unittest: https://docs.python.org/dev/library/unittest.html#command-line-interface
- venv: https://docs.python.org/dev/library/venv.html#creating-virtual-environments
- webbrowser: https://docs.python.org/3.14/library/webbrowser.html
- zipapp: https://docs.python.org/dev/library/zipapp.html#command-line-interface
- zipfile: https://docs.python.org/dev/library/zipfile.html#command-line-interface
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
Labels
Documentation in the Doc dirDocumentation in the Doc dir