blob: f807fecd44135e44d669d9264f15358dba51ef0e [file] [log] [blame]
Guido van Rossum612316f1997-03-14 04:12:52 +00001\chapter{Undocumented Modules}
Fred Drake710c0351998-02-18 15:47:17 +00002\label{undoc}
Guido van Rossum612316f1997-03-14 04:12:52 +00003
4Here's a quick listing of modules that are currently undocumented, but
5that should be documented. Feel free to contribute documentation for
6them! (The idea and most contents for this chapter were taken from a
7posting by Fredrik Lundh; I have revised some modules' status.)
8
9
Fred Drakea007c131997-12-29 21:32:26 +000010\section{Frameworks; somewhat harder to document, but well worth the effort}
Guido van Rossum612316f1997-03-14 04:12:52 +000011
Fred Drake272fb3a1998-04-07 14:15:28 +000012\begin{description}
13\item[Tkinter.py]
14--- Interface to Tcl/Tk for graphical user interfaces;
Guido van Rossum15085381997-04-03 23:49:28 +000015Fredrik Lundh is working on this one!
Guido van Rossum612316f1997-03-14 04:12:52 +000016
Fred Drake95638f51998-04-14 04:55:43 +000017\item[Tkdnd.py]
18--- Drag-and-drop support for \module{Tkinter}.
19
Fred Drake272fb3a1998-04-07 14:15:28 +000020\item[CGIHTTPServer.py]
21--- CGI-savvy HTTP Server
Guido van Rossum612316f1997-03-14 04:12:52 +000022
Fred Drake272fb3a1998-04-07 14:15:28 +000023\item[SimpleHTTPServer.py]
24--- Simple HTTP Server
25\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000026
Guido van Rossum612316f1997-03-14 04:12:52 +000027
28\section{Stuff useful to a lot of people, including the CGI crowd}
29
Fred Drake272fb3a1998-04-07 14:15:28 +000030\begin{description}
31\item[MimeWriter.py]
32--- Generic MIME writer
Guido van Rossum612316f1997-03-14 04:12:52 +000033
Fred Drake272fb3a1998-04-07 14:15:28 +000034\item[multifile.py]
35--- make each part of a multipart message ``feel'' like
36
Fred Drake007bac31998-04-09 18:54:01 +000037\item[smtplib.py]
38--- Simple Mail Transfer Protocol (SMTP) client code.
Fred Drake272fb3a1998-04-07 14:15:28 +000039\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000040
Guido van Rossum612316f1997-03-14 04:12:52 +000041
42\section{Miscellaneous useful utilities}
43
44Some of these are very old and/or not very robust; marked with ``hmm''.
45
Fred Drake272fb3a1998-04-07 14:15:28 +000046\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +000047\item[ConfigParser.py]
48--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000049
Fred Drake272fb3a1998-04-07 14:15:28 +000050\item[cmp.py]
51--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000052
Fred Drake272fb3a1998-04-07 14:15:28 +000053\item[cmpcache.py]
54--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000055
Fred Drake272fb3a1998-04-07 14:15:28 +000056\item[dircache.py]
57--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000058
Fred Drake272fb3a1998-04-07 14:15:28 +000059\item[dircmp.py]
60--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000061
Fred Drake68fede71998-04-13 20:31:31 +000062\item[getpass.py]
63--- Utilities to get a password and/or the current user name.
64
Fred Drake272fb3a1998-04-07 14:15:28 +000065\item[linecache.py]
66--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000067
Fred Drake272fb3a1998-04-07 14:15:28 +000068\item[pipes.py]
69--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000070
Fred Drake272fb3a1998-04-07 14:15:28 +000071\item[statcache.py]
72--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000073
Fred Drake272fb3a1998-04-07 14:15:28 +000074\item[colorsys.py]
75--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000076
Fred Drake272fb3a1998-04-07 14:15:28 +000077\item[dbhash.py]
78--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000079
Fred Drake272fb3a1998-04-07 14:15:28 +000080\item[mhlib.py]
81--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000082
Fred Drake272fb3a1998-04-07 14:15:28 +000083\item[pty.py]
84--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000085
Fred Drake272fb3a1998-04-07 14:15:28 +000086\item[tty.py]
87--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000088
Fred Drake272fb3a1998-04-07 14:15:28 +000089\item[cmd.py]
90--- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000091
Fred Drake272fb3a1998-04-07 14:15:28 +000092\item[bdb.py]
93--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000094
Fred Drake6b9ff721998-04-07 19:09:32 +000095\item[wdb.py]
96--- A primitive windowing debugger based on STDWIN.
97
Fred Drake272fb3a1998-04-07 14:15:28 +000098\item[ihooks.py]
99--- Import hook support (for rexec)
Fred Drake272fb3a1998-04-07 14:15:28 +0000100\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000101
Guido van Rossum90858221997-08-15 02:52:46 +0000102
Guido van Rossum612316f1997-03-14 04:12:52 +0000103\section{Parsing Python}
104
105(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000106parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000107
Fred Drake272fb3a1998-04-07 14:15:28 +0000108\begin{description}
109\item[tokenize.py]
110--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000111contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000112
Fred Drake272fb3a1998-04-07 14:15:28 +0000113\item[pyclbr.py]
114--- Parse a Python file and retrieve classes and methods
115\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000116
117
118\section{Platform specific modules}
119
Fred Drake272fb3a1998-04-07 14:15:28 +0000120\begin{description}
121\item[ntpath.py]
122--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000123
Fred Drake272fb3a1998-04-07 14:15:28 +0000124\item[dospath.py]
125--- equivalent of posixpath on MS-DOS
126\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000127
Guido van Rossum612316f1997-03-14 04:12:52 +0000128
129\section{Code objects and files, debugger etc.}
130
Fred Drake272fb3a1998-04-07 14:15:28 +0000131\begin{description}
132\item[compileall.py]
133--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000134
Fred Drake272fb3a1998-04-07 14:15:28 +0000135\item[py_compile.py]
136--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000137
Fred Drake272fb3a1998-04-07 14:15:28 +0000138\item[repr.py]
139--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000140sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000141\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000142
Guido van Rossum612316f1997-03-14 04:12:52 +0000143
144\section{Multimedia}
145
Fred Drake272fb3a1998-04-07 14:15:28 +0000146\begin{description}
147\item[audiodev.py]
148--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
Fred Drake272fb3a1998-04-07 14:15:28 +0000150\item[sunau.py]
151--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000152
Fred Drake272fb3a1998-04-07 14:15:28 +0000153\item[sunaudio.py]
154--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000155
Fred Drake272fb3a1998-04-07 14:15:28 +0000156\item[toaiff.py]
157--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000158
Fred Drake272fb3a1998-04-07 14:15:28 +0000159\item[sndhdr.py]
160--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000161
Fred Drake272fb3a1998-04-07 14:15:28 +0000162\item[wave.py]
163--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000164
Fred Drake272fb3a1998-04-07 14:15:28 +0000165\item[whatsound.py]
166--- recognizing sound files
167\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000168
169
170\section{Oddities}
171
172These modules are probably also obsolete, or just not very useful.
173
Fred Drake272fb3a1998-04-07 14:15:28 +0000174\begin{description}
175\item[dump.py]
176--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000177
Fred Drake272fb3a1998-04-07 14:15:28 +0000178\item[find.py]
179--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000180
Fred Drake272fb3a1998-04-07 14:15:28 +0000181\item[fpformat.py]
182--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000183interesting demonstration of how to do this without using the \C{}
184library
Guido van Rossum612316f1997-03-14 04:12:52 +0000185
Fred Drake272fb3a1998-04-07 14:15:28 +0000186\item[grep.py]
187--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000188
Fred Drake272fb3a1998-04-07 14:15:28 +0000189\item[mutex.py]
190--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000191
Fred Drake272fb3a1998-04-07 14:15:28 +0000192\item[packmail.py]
193--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000194
Fred Drake272fb3a1998-04-07 14:15:28 +0000195\item[poly.py]
196--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000197
Fred Drake272fb3a1998-04-07 14:15:28 +0000198\item[sched.py]
199--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000200
Fred Drake272fb3a1998-04-07 14:15:28 +0000201\item[shutil.py]
202--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000203
Fred Drake272fb3a1998-04-07 14:15:28 +0000204\item[util.py]
205--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000206
Fred Drake272fb3a1998-04-07 14:15:28 +0000207\item[zmod.py]
208--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000209
Fred Drake272fb3a1998-04-07 14:15:28 +0000210\item[tzparse.py]
211--- Parse a timezone specification (unfinished)
212\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000213
214
215\section{Obsolete}
216
Fred Drake71c1e501998-04-04 07:03:19 +0000217These modules are not on the standard module search path;
218\indexiii{module}{search}{path}
219but are available in the directory \file{lib-old/} installed under
Fred Drake20ca9171998-04-09 14:32:28 +0000220\file{\textrm{\$prefix}/lib/python1.5/}. To use any of these
Fred Drake71c1e501998-04-04 07:03:19 +0000221modules, add that directory to \code{sys.path}, possibly using
222\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000223
Fred Drake272fb3a1998-04-07 14:15:28 +0000224\begin{description}
225\item[newdir.py]
226--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000227
Fred Drake272fb3a1998-04-07 14:15:28 +0000228\item[addpack.py]
229--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000230
Fred Drake272fb3a1998-04-07 14:15:28 +0000231\item[fmt.py]
232--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000233
Fred Drake272fb3a1998-04-07 14:15:28 +0000234\item[Para.py]
235--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000236
Fred Drake272fb3a1998-04-07 14:15:28 +0000237\item[lockfile.py]
238--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000239fcntl.lockf/flock intead)
240
Fred Drake272fb3a1998-04-07 14:15:28 +0000241\item[tb.py]
242--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000243pdb.pm() or traceback.py instead)
244
Fred Drake272fb3a1998-04-07 14:15:28 +0000245\item[codehack.py]
246--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000247code object (these are now accessible as attributes: co.co_name,
248func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000249\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000250
Fred Drake20ca9171998-04-09 14:32:28 +0000251The following modules were documented in previous versions of this
252manual, but are now considered obsolete:
253
254\begin{description}
255\item[ni]
256--- Import modules in ``packages.''
257
258\item[rand]
259--- Old interface to the random number generator.
260
261\item[soundex]
262--- Algorithm for collapsing names which sound similar to a shared
263key. (This is an extension module.)
264\end{description}
265
Guido van Rossum612316f1997-03-14 04:12:52 +0000266
267\section{Extension modules}
268
Fred Drake272fb3a1998-04-07 14:15:28 +0000269\begin{description}
270\item[bsddbmodule.c]
271--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000272dbm clone).
273
Fred Drake272fb3a1998-04-07 14:15:28 +0000274\item[cursesmodule.c]
275--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000276
Fred Drake272fb3a1998-04-07 14:15:28 +0000277\item[dlmodule.c]
278--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000279arbitrary C functions in arbitrary shared libraries.
280
Fred Drake272fb3a1998-04-07 14:15:28 +0000281\item[newmodule.c]
282--- Tommy Burnette's `new' module (creates new empty objects of
283certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000284
Fred Drake272fb3a1998-04-07 14:15:28 +0000285\item[nismodule.c]
286--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000287
Fred Drake272fb3a1998-04-07 14:15:28 +0000288\item[timingmodule.c]
289--- Measure time intervals to high resolution (obsolete --- use
290time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000291
Fred Drake272fb3a1998-04-07 14:15:28 +0000292\item[stdwinmodule.c]
293--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000294platform-independent GUI package). Obsolete; use Tkinter for a
295platform-independent GUI instead.
296
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000297The following are SGI specific:
298
Fred Drake272fb3a1998-04-07 14:15:28 +0000299\item[clmodule.c]
300--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000301
Fred Drake272fb3a1998-04-07 14:15:28 +0000302\item[svmodule.c]
303--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000304(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000305
306The following is Windows specific:
307
Fred Drake272fb3a1998-04-07 14:15:28 +0000308\item[msvcrtmodule.c]
309(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000310specific goodies like \code{khbit()}, \code{getch()} and
311\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000312\end{description}