blob: 3cd5d91c0c60eb6a3b9c28973035a2ff67aa49a3 [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
10\section{Fundamental, and pretty straightforward to document}
11
Fred Drake272fb3a1998-04-07 14:15:28 +000012\begin{description}
13\item[cPickle.c]
14--- mostly the same as pickle but no subclassing
Guido van Rossum08157f81997-08-21 02:29:19 +000015
Fred Drake272fb3a1998-04-07 14:15:28 +000016\item[cStringIO.c]
17--- mostly the same as StringIO but no subclassing
18\end{description}
Guido van Rossum08157f81997-08-21 02:29:19 +000019
Guido van Rossum612316f1997-03-14 04:12:52 +000020
Fred Drakea007c131997-12-29 21:32:26 +000021\section{Frameworks; somewhat harder to document, but well worth the effort}
Guido van Rossum612316f1997-03-14 04:12:52 +000022
Fred Drake272fb3a1998-04-07 14:15:28 +000023\begin{description}
24\item[Tkinter.py]
25--- Interface to Tcl/Tk for graphical user interfaces;
Guido van Rossum15085381997-04-03 23:49:28 +000026Fredrik Lundh is working on this one!
Guido van Rossum612316f1997-03-14 04:12:52 +000027
Fred Drake272fb3a1998-04-07 14:15:28 +000028\item[CGIHTTPServer.py]
29--- CGI-savvy HTTP Server
Guido van Rossum612316f1997-03-14 04:12:52 +000030
Fred Drake272fb3a1998-04-07 14:15:28 +000031\item[SimpleHTTPServer.py]
32--- Simple HTTP Server
33\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000034
Guido van Rossum612316f1997-03-14 04:12:52 +000035
36\section{Stuff useful to a lot of people, including the CGI crowd}
37
Fred Drake272fb3a1998-04-07 14:15:28 +000038\begin{description}
39\item[MimeWriter.py]
40--- Generic MIME writer
Guido van Rossum612316f1997-03-14 04:12:52 +000041
Fred Drake272fb3a1998-04-07 14:15:28 +000042\item[multifile.py]
43--- make each part of a multipart message ``feel'' like
44
45\item[poplib.py]
46--- Post Office Protocol client by Dave Ascher.
47\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000048
Guido van Rossum612316f1997-03-14 04:12:52 +000049
50\section{Miscellaneous useful utilities}
51
52Some of these are very old and/or not very robust; marked with ``hmm''.
53
Fred Drake272fb3a1998-04-07 14:15:28 +000054\begin{description}
55\item[calendar.py]
56--- Calendar printing functions
Guido van Rossum612316f1997-03-14 04:12:52 +000057
Fred Drake272fb3a1998-04-07 14:15:28 +000058\item[ConfigParser.py]
59--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000060
Fred Drake272fb3a1998-04-07 14:15:28 +000061\item[cmp.py]
62--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000063
Fred Drake272fb3a1998-04-07 14:15:28 +000064\item[cmpcache.py]
65--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000066
Fred Drake272fb3a1998-04-07 14:15:28 +000067\item[dircache.py]
68--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake272fb3a1998-04-07 14:15:28 +000070\item[dircmp.py]
71--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000072
Fred Drake272fb3a1998-04-07 14:15:28 +000073\item[linecache.py]
74--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000075
Fred Drake272fb3a1998-04-07 14:15:28 +000076\item[pipes.py]
77--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000078
Fred Drake272fb3a1998-04-07 14:15:28 +000079\item[popen2.py]
80--- improved popen, can read AND write simultaneously
Guido van Rossum612316f1997-03-14 04:12:52 +000081
Fred Drake272fb3a1998-04-07 14:15:28 +000082\item[statcache.py]
83--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000084
Fred Drake272fb3a1998-04-07 14:15:28 +000085\item[colorsys.py]
86--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000087
Fred Drake272fb3a1998-04-07 14:15:28 +000088\item[dbhash.py]
89--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000090
Fred Drake272fb3a1998-04-07 14:15:28 +000091\item[mhlib.py]
92--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000093
Fred Drake272fb3a1998-04-07 14:15:28 +000094\item[pty.py]
95--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000096
Fred Drake272fb3a1998-04-07 14:15:28 +000097\item[tty.py]
98--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000099
Fred Drake272fb3a1998-04-07 14:15:28 +0000100\item[cmd.py]
101--- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000102
Fred Drake272fb3a1998-04-07 14:15:28 +0000103\item[bdb.py]
104--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000105
Fred Drake272fb3a1998-04-07 14:15:28 +0000106\item[ihooks.py]
107--- Import hook support (for rexec)
Fred Drake71c1e501998-04-04 07:03:19 +0000108
Fred Drake272fb3a1998-04-07 14:15:28 +0000109\item[bisect.py]
110--- Bisection algorithms (this is actually useful at times,
Fred Drake71c1e501998-04-04 07:03:19 +0000111especially as reference material)
Fred Drake272fb3a1998-04-07 14:15:28 +0000112\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000113
Guido van Rossum90858221997-08-15 02:52:46 +0000114
Guido van Rossum612316f1997-03-14 04:12:52 +0000115\section{Parsing Python}
116
117(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000118parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000119
Fred Drake272fb3a1998-04-07 14:15:28 +0000120\begin{description}
121\item[tokenize.py]
122--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000123contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000124
Fred Drake272fb3a1998-04-07 14:15:28 +0000125\item[pyclbr.py]
126--- Parse a Python file and retrieve classes and methods
127\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000128
129
130\section{Platform specific modules}
131
Fred Drake272fb3a1998-04-07 14:15:28 +0000132\begin{description}
133\item[ntpath.py]
134--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000135
Fred Drake272fb3a1998-04-07 14:15:28 +0000136\item[dospath.py]
137--- equivalent of posixpath on MS-DOS
138\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000139
Guido van Rossum612316f1997-03-14 04:12:52 +0000140
141\section{Code objects and files, debugger etc.}
142
Fred Drake272fb3a1998-04-07 14:15:28 +0000143\begin{description}
144\item[compileall.py]
145--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000146
Fred Drake272fb3a1998-04-07 14:15:28 +0000147\item[py_compile.py]
148--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
Fred Drake272fb3a1998-04-07 14:15:28 +0000150\item[repr.py]
151--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000152sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000153\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000154
Guido van Rossum612316f1997-03-14 04:12:52 +0000155
156\section{Multimedia}
157
Fred Drake272fb3a1998-04-07 14:15:28 +0000158\begin{description}
159\item[audiodev.py]
160--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000161
Fred Drake272fb3a1998-04-07 14:15:28 +0000162\item[sunau.py]
163--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000164
Fred Drake272fb3a1998-04-07 14:15:28 +0000165\item[sunaudio.py]
166--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000167
Fred Drake272fb3a1998-04-07 14:15:28 +0000168\item[toaiff.py]
169--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000170
Fred Drake272fb3a1998-04-07 14:15:28 +0000171\item[sndhdr.py]
172--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000173
Fred Drake272fb3a1998-04-07 14:15:28 +0000174\item[wave.py]
175--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000176
Fred Drake272fb3a1998-04-07 14:15:28 +0000177\item[whatsound.py]
178--- recognizing sound files
179\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000180
181
182\section{Oddities}
183
184These modules are probably also obsolete, or just not very useful.
185
Fred Drake272fb3a1998-04-07 14:15:28 +0000186\begin{description}
187\item[dump.py]
188--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000189
Fred Drake272fb3a1998-04-07 14:15:28 +0000190\item[find.py]
191--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000192
Fred Drake272fb3a1998-04-07 14:15:28 +0000193\item[fpformat.py]
194--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000195interesting demonstration of how to do this without using the \C{}
196library
Guido van Rossum612316f1997-03-14 04:12:52 +0000197
Fred Drake272fb3a1998-04-07 14:15:28 +0000198\item[grep.py]
199--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000200
Fred Drake272fb3a1998-04-07 14:15:28 +0000201\item[mutex.py]
202--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000203
Fred Drake272fb3a1998-04-07 14:15:28 +0000204\item[packmail.py]
205--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000206
Fred Drake272fb3a1998-04-07 14:15:28 +0000207\item[poly.py]
208--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000209
Fred Drake272fb3a1998-04-07 14:15:28 +0000210\item[sched.py]
211--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000212
Fred Drake272fb3a1998-04-07 14:15:28 +0000213\item[shutil.py]
214--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000215
Fred Drake272fb3a1998-04-07 14:15:28 +0000216\item[util.py]
217--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000218
Fred Drake272fb3a1998-04-07 14:15:28 +0000219\item[zmod.py]
220--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000221
Fred Drake272fb3a1998-04-07 14:15:28 +0000222\item[tzparse.py]
223--- Parse a timezone specification (unfinished)
224\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000225
226
227\section{Obsolete}
228
Fred Drake71c1e501998-04-04 07:03:19 +0000229These modules are not on the standard module search path;
230\indexiii{module}{search}{path}
231but are available in the directory \file{lib-old/} installed under
232\file{\textrm{\$prefix}/lib/python\version/}. To use any of these
233modules, add that directory to \code{sys.path}, possibly using
234\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000235
Fred Drake272fb3a1998-04-07 14:15:28 +0000236\begin{description}
237\item[newdir.py]
238--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000239
Fred Drake272fb3a1998-04-07 14:15:28 +0000240\item[addpack.py]
241--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000242
Fred Drake272fb3a1998-04-07 14:15:28 +0000243\item[fmt.py]
244--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000245
Fred Drake272fb3a1998-04-07 14:15:28 +0000246\item[Para.py]
247--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000248
Fred Drake272fb3a1998-04-07 14:15:28 +0000249\item[lockfile.py]
250--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000251fcntl.lockf/flock intead)
252
Fred Drake272fb3a1998-04-07 14:15:28 +0000253\item[tb.py]
254--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000255pdb.pm() or traceback.py instead)
256
Fred Drake272fb3a1998-04-07 14:15:28 +0000257\item[codehack.py]
258--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000259code object (these are now accessible as attributes: co.co_name,
260func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000261\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000262
Guido van Rossum612316f1997-03-14 04:12:52 +0000263
264\section{Extension modules}
265
Fred Drake272fb3a1998-04-07 14:15:28 +0000266\begin{description}
267\item[bsddbmodule.c]
268--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000269dbm clone).
270
Fred Drake272fb3a1998-04-07 14:15:28 +0000271\item[cursesmodule.c]
272--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000273
Fred Drake272fb3a1998-04-07 14:15:28 +0000274\item[dlmodule.c]
275--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000276arbitrary C functions in arbitrary shared libraries.
277
Fred Drake272fb3a1998-04-07 14:15:28 +0000278\item[newmodule.c]
279--- Tommy Burnette's `new' module (creates new empty objects of
280certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000281
Fred Drake272fb3a1998-04-07 14:15:28 +0000282\item[nismodule.c]
283--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000284
Fred Drake272fb3a1998-04-07 14:15:28 +0000285\item[timingmodule.c]
286--- Measure time intervals to high resolution (obsolete --- use
287time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000288
Fred Drake272fb3a1998-04-07 14:15:28 +0000289\item[stdwinmodule.c]
290--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000291platform-independent GUI package). Obsolete; use Tkinter for a
292platform-independent GUI instead.
293
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000294The following are SGI specific:
295
Fred Drake272fb3a1998-04-07 14:15:28 +0000296\item[clmodule.c]
297--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000298
Fred Drake272fb3a1998-04-07 14:15:28 +0000299\item[svmodule.c]
300--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000301(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000302
303The following is Windows specific:
304
Fred Drake272fb3a1998-04-07 14:15:28 +0000305\item[msvcrtmodule.c]
306(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000307specific goodies like \code{khbit()}, \code{getch()} and
308\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000309\end{description}