blob: b63574db54851c31bb9ec5e1d564b008f01c3bf0 [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}
Fred Drake223395c1998-04-09 13:55:06 +000039\item[imaplib.py]
40--- IMAP4 client class by Pier Lauder.
41
Fred Drake272fb3a1998-04-07 14:15:28 +000042\item[MimeWriter.py]
43--- Generic MIME writer
Guido van Rossum612316f1997-03-14 04:12:52 +000044
Fred Drake272fb3a1998-04-07 14:15:28 +000045\item[multifile.py]
46--- make each part of a multipart message ``feel'' like
47
48\item[poplib.py]
49--- Post Office Protocol client by Dave Ascher.
Fred Drake007bac31998-04-09 18:54:01 +000050
51\item[smtplib.py]
52--- Simple Mail Transfer Protocol (SMTP) client code.
Fred Drake272fb3a1998-04-07 14:15:28 +000053\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000054
Guido van Rossum612316f1997-03-14 04:12:52 +000055
56\section{Miscellaneous useful utilities}
57
58Some of these are very old and/or not very robust; marked with ``hmm''.
59
Fred Drake272fb3a1998-04-07 14:15:28 +000060\begin{description}
61\item[calendar.py]
62--- Calendar printing functions
Guido van Rossum612316f1997-03-14 04:12:52 +000063
Fred Drake272fb3a1998-04-07 14:15:28 +000064\item[ConfigParser.py]
65--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000066
Fred Drake272fb3a1998-04-07 14:15:28 +000067\item[cmp.py]
68--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake272fb3a1998-04-07 14:15:28 +000070\item[cmpcache.py]
71--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000072
Fred Drake272fb3a1998-04-07 14:15:28 +000073\item[dircache.py]
74--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000075
Fred Drake272fb3a1998-04-07 14:15:28 +000076\item[dircmp.py]
77--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000078
Fred Drake272fb3a1998-04-07 14:15:28 +000079\item[linecache.py]
80--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000081
Fred Drake272fb3a1998-04-07 14:15:28 +000082\item[pipes.py]
83--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000084
Fred Drake272fb3a1998-04-07 14:15:28 +000085\item[popen2.py]
86--- improved popen, can read AND write simultaneously
Guido van Rossum612316f1997-03-14 04:12:52 +000087
Fred Drake272fb3a1998-04-07 14:15:28 +000088\item[statcache.py]
89--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000090
Fred Drake272fb3a1998-04-07 14:15:28 +000091\item[colorsys.py]
92--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000093
Fred Drake272fb3a1998-04-07 14:15:28 +000094\item[dbhash.py]
95--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000096
Fred Drake272fb3a1998-04-07 14:15:28 +000097\item[mhlib.py]
98--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000099
Fred Drake272fb3a1998-04-07 14:15:28 +0000100\item[pty.py]
101--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +0000102
Fred Drake272fb3a1998-04-07 14:15:28 +0000103\item[tty.py]
104--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +0000105
Fred Drake272fb3a1998-04-07 14:15:28 +0000106\item[cmd.py]
107--- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000108
Fred Drake272fb3a1998-04-07 14:15:28 +0000109\item[bdb.py]
110--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000111
Fred Drake6b9ff721998-04-07 19:09:32 +0000112\item[wdb.py]
113--- A primitive windowing debugger based on STDWIN.
114
Fred Drake272fb3a1998-04-07 14:15:28 +0000115\item[ihooks.py]
116--- Import hook support (for rexec)
Fred Drake71c1e501998-04-04 07:03:19 +0000117
Fred Drake272fb3a1998-04-07 14:15:28 +0000118\item[bisect.py]
119--- Bisection algorithms (this is actually useful at times,
Fred Drake71c1e501998-04-04 07:03:19 +0000120especially as reference material)
Fred Drake272fb3a1998-04-07 14:15:28 +0000121\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000122
Guido van Rossum90858221997-08-15 02:52:46 +0000123
Guido van Rossum612316f1997-03-14 04:12:52 +0000124\section{Parsing Python}
125
126(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000127parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000128
Fred Drake272fb3a1998-04-07 14:15:28 +0000129\begin{description}
130\item[tokenize.py]
131--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000132contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000133
Fred Drake272fb3a1998-04-07 14:15:28 +0000134\item[pyclbr.py]
135--- Parse a Python file and retrieve classes and methods
136\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000137
138
139\section{Platform specific modules}
140
Fred Drake272fb3a1998-04-07 14:15:28 +0000141\begin{description}
142\item[ntpath.py]
143--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000144
Fred Drake272fb3a1998-04-07 14:15:28 +0000145\item[dospath.py]
146--- equivalent of posixpath on MS-DOS
147\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000148
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
150\section{Code objects and files, debugger etc.}
151
Fred Drake272fb3a1998-04-07 14:15:28 +0000152\begin{description}
153\item[compileall.py]
154--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000155
Fred Drake272fb3a1998-04-07 14:15:28 +0000156\item[py_compile.py]
157--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000158
Fred Drake272fb3a1998-04-07 14:15:28 +0000159\item[repr.py]
160--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000161sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000162\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000163
Guido van Rossum612316f1997-03-14 04:12:52 +0000164
165\section{Multimedia}
166
Fred Drake272fb3a1998-04-07 14:15:28 +0000167\begin{description}
168\item[audiodev.py]
169--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000170
Fred Drake272fb3a1998-04-07 14:15:28 +0000171\item[sunau.py]
172--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000173
Fred Drake272fb3a1998-04-07 14:15:28 +0000174\item[sunaudio.py]
175--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000176
Fred Drake272fb3a1998-04-07 14:15:28 +0000177\item[toaiff.py]
178--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000179
Fred Drake272fb3a1998-04-07 14:15:28 +0000180\item[sndhdr.py]
181--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000182
Fred Drake272fb3a1998-04-07 14:15:28 +0000183\item[wave.py]
184--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000185
Fred Drake272fb3a1998-04-07 14:15:28 +0000186\item[whatsound.py]
187--- recognizing sound files
188\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000189
190
191\section{Oddities}
192
193These modules are probably also obsolete, or just not very useful.
194
Fred Drake272fb3a1998-04-07 14:15:28 +0000195\begin{description}
196\item[dump.py]
197--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000198
Fred Drake272fb3a1998-04-07 14:15:28 +0000199\item[find.py]
200--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000201
Fred Drake272fb3a1998-04-07 14:15:28 +0000202\item[fpformat.py]
203--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000204interesting demonstration of how to do this without using the \C{}
205library
Guido van Rossum612316f1997-03-14 04:12:52 +0000206
Fred Drake272fb3a1998-04-07 14:15:28 +0000207\item[grep.py]
208--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000209
Fred Drake272fb3a1998-04-07 14:15:28 +0000210\item[mutex.py]
211--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000212
Fred Drake272fb3a1998-04-07 14:15:28 +0000213\item[packmail.py]
214--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000215
Fred Drake272fb3a1998-04-07 14:15:28 +0000216\item[poly.py]
217--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000218
Fred Drake272fb3a1998-04-07 14:15:28 +0000219\item[sched.py]
220--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000221
Fred Drake272fb3a1998-04-07 14:15:28 +0000222\item[shutil.py]
223--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000224
Fred Drake272fb3a1998-04-07 14:15:28 +0000225\item[util.py]
226--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000227
Fred Drake272fb3a1998-04-07 14:15:28 +0000228\item[zmod.py]
229--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000230
Fred Drake272fb3a1998-04-07 14:15:28 +0000231\item[tzparse.py]
232--- Parse a timezone specification (unfinished)
233\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000234
235
236\section{Obsolete}
237
Fred Drake71c1e501998-04-04 07:03:19 +0000238These modules are not on the standard module search path;
239\indexiii{module}{search}{path}
240but are available in the directory \file{lib-old/} installed under
Fred Drake20ca9171998-04-09 14:32:28 +0000241\file{\textrm{\$prefix}/lib/python1.5/}. To use any of these
Fred Drake71c1e501998-04-04 07:03:19 +0000242modules, add that directory to \code{sys.path}, possibly using
243\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000244
Fred Drake272fb3a1998-04-07 14:15:28 +0000245\begin{description}
246\item[newdir.py]
247--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000248
Fred Drake272fb3a1998-04-07 14:15:28 +0000249\item[addpack.py]
250--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000251
Fred Drake272fb3a1998-04-07 14:15:28 +0000252\item[fmt.py]
253--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000254
Fred Drake272fb3a1998-04-07 14:15:28 +0000255\item[Para.py]
256--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000257
Fred Drake272fb3a1998-04-07 14:15:28 +0000258\item[lockfile.py]
259--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000260fcntl.lockf/flock intead)
261
Fred Drake272fb3a1998-04-07 14:15:28 +0000262\item[tb.py]
263--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000264pdb.pm() or traceback.py instead)
265
Fred Drake272fb3a1998-04-07 14:15:28 +0000266\item[codehack.py]
267--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000268code object (these are now accessible as attributes: co.co_name,
269func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000270\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000271
Fred Drake20ca9171998-04-09 14:32:28 +0000272The following modules were documented in previous versions of this
273manual, but are now considered obsolete:
274
275\begin{description}
276\item[ni]
277--- Import modules in ``packages.''
278
279\item[rand]
280--- Old interface to the random number generator.
281
282\item[soundex]
283--- Algorithm for collapsing names which sound similar to a shared
284key. (This is an extension module.)
285\end{description}
286
Guido van Rossum612316f1997-03-14 04:12:52 +0000287
288\section{Extension modules}
289
Fred Drake272fb3a1998-04-07 14:15:28 +0000290\begin{description}
291\item[bsddbmodule.c]
292--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000293dbm clone).
294
Fred Drake272fb3a1998-04-07 14:15:28 +0000295\item[cursesmodule.c]
296--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000297
Fred Drake272fb3a1998-04-07 14:15:28 +0000298\item[dlmodule.c]
299--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000300arbitrary C functions in arbitrary shared libraries.
301
Fred Drake272fb3a1998-04-07 14:15:28 +0000302\item[newmodule.c]
303--- Tommy Burnette's `new' module (creates new empty objects of
304certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000305
Fred Drake272fb3a1998-04-07 14:15:28 +0000306\item[nismodule.c]
307--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000308
Fred Drake272fb3a1998-04-07 14:15:28 +0000309\item[timingmodule.c]
310--- Measure time intervals to high resolution (obsolete --- use
311time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000312
Fred Drake272fb3a1998-04-07 14:15:28 +0000313\item[stdwinmodule.c]
314--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000315platform-independent GUI package). Obsolete; use Tkinter for a
316platform-independent GUI instead.
317
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000318The following are SGI specific:
319
Fred Drake272fb3a1998-04-07 14:15:28 +0000320\item[clmodule.c]
321--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000322
Fred Drake272fb3a1998-04-07 14:15:28 +0000323\item[svmodule.c]
324--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000325(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000326
327The following is Windows specific:
328
Fred Drake272fb3a1998-04-07 14:15:28 +0000329\item[msvcrtmodule.c]
330(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000331specific goodies like \code{khbit()}, \code{getch()} and
332\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000333\end{description}