blob: 5f971339914c47e7274bf14ec008f828e80e19ab [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
37\item[poplib.py]
38--- Post Office Protocol client by Dave Ascher.
Fred Drake007bac31998-04-09 18:54:01 +000039
40\item[smtplib.py]
41--- Simple Mail Transfer Protocol (SMTP) client code.
Fred Drake272fb3a1998-04-07 14:15:28 +000042\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000043
Guido van Rossum612316f1997-03-14 04:12:52 +000044
45\section{Miscellaneous useful utilities}
46
47Some of these are very old and/or not very robust; marked with ``hmm''.
48
Fred Drake272fb3a1998-04-07 14:15:28 +000049\begin{description}
50\item[calendar.py]
51--- Calendar printing functions
Guido van Rossum612316f1997-03-14 04:12:52 +000052
Fred Drake272fb3a1998-04-07 14:15:28 +000053\item[ConfigParser.py]
54--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000055
Fred Drake272fb3a1998-04-07 14:15:28 +000056\item[cmp.py]
57--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000058
Fred Drake272fb3a1998-04-07 14:15:28 +000059\item[cmpcache.py]
60--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000061
Fred Drake272fb3a1998-04-07 14:15:28 +000062\item[dircache.py]
63--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000064
Fred Drake272fb3a1998-04-07 14:15:28 +000065\item[dircmp.py]
66--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000067
Fred Drake68fede71998-04-13 20:31:31 +000068\item[getpass.py]
69--- Utilities to get a password and/or the current user name.
70
Fred Drake272fb3a1998-04-07 14:15:28 +000071\item[linecache.py]
72--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000073
Fred Drake272fb3a1998-04-07 14:15:28 +000074\item[pipes.py]
75--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000076
Fred Drake272fb3a1998-04-07 14:15:28 +000077\item[popen2.py]
78--- improved popen, can read AND write simultaneously
Guido van Rossum612316f1997-03-14 04:12:52 +000079
Fred Drake272fb3a1998-04-07 14:15:28 +000080\item[statcache.py]
81--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000082
Fred Drake272fb3a1998-04-07 14:15:28 +000083\item[colorsys.py]
84--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000085
Fred Drake272fb3a1998-04-07 14:15:28 +000086\item[dbhash.py]
87--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000088
Fred Drake272fb3a1998-04-07 14:15:28 +000089\item[mhlib.py]
90--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000091
Fred Drake272fb3a1998-04-07 14:15:28 +000092\item[pty.py]
93--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000094
Fred Drake272fb3a1998-04-07 14:15:28 +000095\item[tty.py]
96--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000097
Fred Drake272fb3a1998-04-07 14:15:28 +000098\item[cmd.py]
99--- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000100
Fred Drake272fb3a1998-04-07 14:15:28 +0000101\item[bdb.py]
102--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000103
Fred Drake6b9ff721998-04-07 19:09:32 +0000104\item[wdb.py]
105--- A primitive windowing debugger based on STDWIN.
106
Fred Drake272fb3a1998-04-07 14:15:28 +0000107\item[ihooks.py]
108--- Import hook support (for rexec)
Fred Drake71c1e501998-04-04 07:03:19 +0000109
Fred Drake272fb3a1998-04-07 14:15:28 +0000110\item[bisect.py]
111--- Bisection algorithms (this is actually useful at times,
Fred Drake71c1e501998-04-04 07:03:19 +0000112especially as reference material)
Fred Drake272fb3a1998-04-07 14:15:28 +0000113\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000114
Guido van Rossum90858221997-08-15 02:52:46 +0000115
Guido van Rossum612316f1997-03-14 04:12:52 +0000116\section{Parsing Python}
117
118(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000119parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000120
Fred Drake272fb3a1998-04-07 14:15:28 +0000121\begin{description}
122\item[tokenize.py]
123--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000124contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000125
Fred Drake272fb3a1998-04-07 14:15:28 +0000126\item[pyclbr.py]
127--- Parse a Python file and retrieve classes and methods
128\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000129
130
131\section{Platform specific modules}
132
Fred Drake272fb3a1998-04-07 14:15:28 +0000133\begin{description}
134\item[ntpath.py]
135--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000136
Fred Drake272fb3a1998-04-07 14:15:28 +0000137\item[dospath.py]
138--- equivalent of posixpath on MS-DOS
139\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000140
Guido van Rossum612316f1997-03-14 04:12:52 +0000141
142\section{Code objects and files, debugger etc.}
143
Fred Drake272fb3a1998-04-07 14:15:28 +0000144\begin{description}
145\item[compileall.py]
146--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000147
Fred Drake272fb3a1998-04-07 14:15:28 +0000148\item[py_compile.py]
149--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000150
Fred Drake272fb3a1998-04-07 14:15:28 +0000151\item[repr.py]
152--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000153sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000154\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000155
Guido van Rossum612316f1997-03-14 04:12:52 +0000156
157\section{Multimedia}
158
Fred Drake272fb3a1998-04-07 14:15:28 +0000159\begin{description}
160\item[audiodev.py]
161--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000162
Fred Drake272fb3a1998-04-07 14:15:28 +0000163\item[sunau.py]
164--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000165
Fred Drake272fb3a1998-04-07 14:15:28 +0000166\item[sunaudio.py]
167--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000168
Fred Drake272fb3a1998-04-07 14:15:28 +0000169\item[toaiff.py]
170--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000171
Fred Drake272fb3a1998-04-07 14:15:28 +0000172\item[sndhdr.py]
173--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000174
Fred Drake272fb3a1998-04-07 14:15:28 +0000175\item[wave.py]
176--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000177
Fred Drake272fb3a1998-04-07 14:15:28 +0000178\item[whatsound.py]
179--- recognizing sound files
180\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000181
182
183\section{Oddities}
184
185These modules are probably also obsolete, or just not very useful.
186
Fred Drake272fb3a1998-04-07 14:15:28 +0000187\begin{description}
188\item[dump.py]
189--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000190
Fred Drake272fb3a1998-04-07 14:15:28 +0000191\item[find.py]
192--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000193
Fred Drake272fb3a1998-04-07 14:15:28 +0000194\item[fpformat.py]
195--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000196interesting demonstration of how to do this without using the \C{}
197library
Guido van Rossum612316f1997-03-14 04:12:52 +0000198
Fred Drake272fb3a1998-04-07 14:15:28 +0000199\item[grep.py]
200--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000201
Fred Drake272fb3a1998-04-07 14:15:28 +0000202\item[mutex.py]
203--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000204
Fred Drake272fb3a1998-04-07 14:15:28 +0000205\item[packmail.py]
206--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000207
Fred Drake272fb3a1998-04-07 14:15:28 +0000208\item[poly.py]
209--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000210
Fred Drake272fb3a1998-04-07 14:15:28 +0000211\item[sched.py]
212--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000213
Fred Drake272fb3a1998-04-07 14:15:28 +0000214\item[shutil.py]
215--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000216
Fred Drake272fb3a1998-04-07 14:15:28 +0000217\item[util.py]
218--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000219
Fred Drake272fb3a1998-04-07 14:15:28 +0000220\item[zmod.py]
221--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000222
Fred Drake272fb3a1998-04-07 14:15:28 +0000223\item[tzparse.py]
224--- Parse a timezone specification (unfinished)
225\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000226
227
228\section{Obsolete}
229
Fred Drake71c1e501998-04-04 07:03:19 +0000230These modules are not on the standard module search path;
231\indexiii{module}{search}{path}
232but are available in the directory \file{lib-old/} installed under
Fred Drake20ca9171998-04-09 14:32:28 +0000233\file{\textrm{\$prefix}/lib/python1.5/}. To use any of these
Fred Drake71c1e501998-04-04 07:03:19 +0000234modules, add that directory to \code{sys.path}, possibly using
235\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000236
Fred Drake272fb3a1998-04-07 14:15:28 +0000237\begin{description}
238\item[newdir.py]
239--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000240
Fred Drake272fb3a1998-04-07 14:15:28 +0000241\item[addpack.py]
242--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000243
Fred Drake272fb3a1998-04-07 14:15:28 +0000244\item[fmt.py]
245--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000246
Fred Drake272fb3a1998-04-07 14:15:28 +0000247\item[Para.py]
248--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000249
Fred Drake272fb3a1998-04-07 14:15:28 +0000250\item[lockfile.py]
251--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000252fcntl.lockf/flock intead)
253
Fred Drake272fb3a1998-04-07 14:15:28 +0000254\item[tb.py]
255--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000256pdb.pm() or traceback.py instead)
257
Fred Drake272fb3a1998-04-07 14:15:28 +0000258\item[codehack.py]
259--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000260code object (these are now accessible as attributes: co.co_name,
261func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000262\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000263
Fred Drake20ca9171998-04-09 14:32:28 +0000264The following modules were documented in previous versions of this
265manual, but are now considered obsolete:
266
267\begin{description}
268\item[ni]
269--- Import modules in ``packages.''
270
271\item[rand]
272--- Old interface to the random number generator.
273
274\item[soundex]
275--- Algorithm for collapsing names which sound similar to a shared
276key. (This is an extension module.)
277\end{description}
278
Guido van Rossum612316f1997-03-14 04:12:52 +0000279
280\section{Extension modules}
281
Fred Drake272fb3a1998-04-07 14:15:28 +0000282\begin{description}
283\item[bsddbmodule.c]
284--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000285dbm clone).
286
Fred Drake272fb3a1998-04-07 14:15:28 +0000287\item[cursesmodule.c]
288--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000289
Fred Drake272fb3a1998-04-07 14:15:28 +0000290\item[dlmodule.c]
291--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000292arbitrary C functions in arbitrary shared libraries.
293
Fred Drake272fb3a1998-04-07 14:15:28 +0000294\item[newmodule.c]
295--- Tommy Burnette's `new' module (creates new empty objects of
296certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000297
Fred Drake272fb3a1998-04-07 14:15:28 +0000298\item[nismodule.c]
299--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000300
Fred Drake272fb3a1998-04-07 14:15:28 +0000301\item[timingmodule.c]
302--- Measure time intervals to high resolution (obsolete --- use
303time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000304
Fred Drake272fb3a1998-04-07 14:15:28 +0000305\item[stdwinmodule.c]
306--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000307platform-independent GUI package). Obsolete; use Tkinter for a
308platform-independent GUI instead.
309
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000310The following are SGI specific:
311
Fred Drake272fb3a1998-04-07 14:15:28 +0000312\item[clmodule.c]
313--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000314
Fred Drake272fb3a1998-04-07 14:15:28 +0000315\item[svmodule.c]
316--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000317(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000318
319The following is Windows specific:
320
Fred Drake272fb3a1998-04-07 14:15:28 +0000321\item[msvcrtmodule.c]
322(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000323specific goodies like \code{khbit()}, \code{getch()} and
324\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000325\end{description}