blob: 0db5e8c54090849b7189743a086151edd36fd646 [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.
50\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000051
Guido van Rossum612316f1997-03-14 04:12:52 +000052
53\section{Miscellaneous useful utilities}
54
55Some of these are very old and/or not very robust; marked with ``hmm''.
56
Fred Drake272fb3a1998-04-07 14:15:28 +000057\begin{description}
58\item[calendar.py]
59--- Calendar printing functions
Guido van Rossum612316f1997-03-14 04:12:52 +000060
Fred Drake272fb3a1998-04-07 14:15:28 +000061\item[ConfigParser.py]
62--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000063
Fred Drake272fb3a1998-04-07 14:15:28 +000064\item[cmp.py]
65--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000066
Fred Drake272fb3a1998-04-07 14:15:28 +000067\item[cmpcache.py]
68--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake272fb3a1998-04-07 14:15:28 +000070\item[dircache.py]
71--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000072
Fred Drake272fb3a1998-04-07 14:15:28 +000073\item[dircmp.py]
74--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000075
Fred Drake272fb3a1998-04-07 14:15:28 +000076\item[linecache.py]
77--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000078
Fred Drake272fb3a1998-04-07 14:15:28 +000079\item[pipes.py]
80--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000081
Fred Drake272fb3a1998-04-07 14:15:28 +000082\item[popen2.py]
83--- improved popen, can read AND write simultaneously
Guido van Rossum612316f1997-03-14 04:12:52 +000084
Fred Drake272fb3a1998-04-07 14:15:28 +000085\item[statcache.py]
86--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000087
Fred Drake272fb3a1998-04-07 14:15:28 +000088\item[colorsys.py]
89--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000090
Fred Drake272fb3a1998-04-07 14:15:28 +000091\item[dbhash.py]
92--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000093
Fred Drake272fb3a1998-04-07 14:15:28 +000094\item[mhlib.py]
95--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000096
Fred Drake272fb3a1998-04-07 14:15:28 +000097\item[pty.py]
98--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000099
Fred Drake272fb3a1998-04-07 14:15:28 +0000100\item[tty.py]
101--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +0000102
Fred Drake272fb3a1998-04-07 14:15:28 +0000103\item[cmd.py]
104--- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000105
Fred Drake272fb3a1998-04-07 14:15:28 +0000106\item[bdb.py]
107--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +0000108
Fred Drake6b9ff721998-04-07 19:09:32 +0000109\item[wdb.py]
110--- A primitive windowing debugger based on STDWIN.
111
Fred Drake272fb3a1998-04-07 14:15:28 +0000112\item[ihooks.py]
113--- Import hook support (for rexec)
Fred Drake71c1e501998-04-04 07:03:19 +0000114
Fred Drake272fb3a1998-04-07 14:15:28 +0000115\item[bisect.py]
116--- Bisection algorithms (this is actually useful at times,
Fred Drake71c1e501998-04-04 07:03:19 +0000117especially as reference material)
Fred Drake272fb3a1998-04-07 14:15:28 +0000118\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000119
Guido van Rossum90858221997-08-15 02:52:46 +0000120
Guido van Rossum612316f1997-03-14 04:12:52 +0000121\section{Parsing Python}
122
123(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000124parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000125
Fred Drake272fb3a1998-04-07 14:15:28 +0000126\begin{description}
127\item[tokenize.py]
128--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000129contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000130
Fred Drake272fb3a1998-04-07 14:15:28 +0000131\item[pyclbr.py]
132--- Parse a Python file and retrieve classes and methods
133\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000134
135
136\section{Platform specific modules}
137
Fred Drake272fb3a1998-04-07 14:15:28 +0000138\begin{description}
139\item[ntpath.py]
140--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000141
Fred Drake272fb3a1998-04-07 14:15:28 +0000142\item[dospath.py]
143--- equivalent of posixpath on MS-DOS
144\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000145
Guido van Rossum612316f1997-03-14 04:12:52 +0000146
147\section{Code objects and files, debugger etc.}
148
Fred Drake272fb3a1998-04-07 14:15:28 +0000149\begin{description}
150\item[compileall.py]
151--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000152
Fred Drake272fb3a1998-04-07 14:15:28 +0000153\item[py_compile.py]
154--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000155
Fred Drake272fb3a1998-04-07 14:15:28 +0000156\item[repr.py]
157--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000158sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000159\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000160
Guido van Rossum612316f1997-03-14 04:12:52 +0000161
162\section{Multimedia}
163
Fred Drake272fb3a1998-04-07 14:15:28 +0000164\begin{description}
165\item[audiodev.py]
166--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000167
Fred Drake272fb3a1998-04-07 14:15:28 +0000168\item[sunau.py]
169--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000170
Fred Drake272fb3a1998-04-07 14:15:28 +0000171\item[sunaudio.py]
172--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000173
Fred Drake272fb3a1998-04-07 14:15:28 +0000174\item[toaiff.py]
175--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000176
Fred Drake272fb3a1998-04-07 14:15:28 +0000177\item[sndhdr.py]
178--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000179
Fred Drake272fb3a1998-04-07 14:15:28 +0000180\item[wave.py]
181--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000182
Fred Drake272fb3a1998-04-07 14:15:28 +0000183\item[whatsound.py]
184--- recognizing sound files
185\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000186
187
188\section{Oddities}
189
190These modules are probably also obsolete, or just not very useful.
191
Fred Drake272fb3a1998-04-07 14:15:28 +0000192\begin{description}
193\item[dump.py]
194--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000195
Fred Drake272fb3a1998-04-07 14:15:28 +0000196\item[find.py]
197--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000198
Fred Drake272fb3a1998-04-07 14:15:28 +0000199\item[fpformat.py]
200--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000201interesting demonstration of how to do this without using the \C{}
202library
Guido van Rossum612316f1997-03-14 04:12:52 +0000203
Fred Drake272fb3a1998-04-07 14:15:28 +0000204\item[grep.py]
205--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000206
Fred Drake272fb3a1998-04-07 14:15:28 +0000207\item[mutex.py]
208--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000209
Fred Drake272fb3a1998-04-07 14:15:28 +0000210\item[packmail.py]
211--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000212
Fred Drake272fb3a1998-04-07 14:15:28 +0000213\item[poly.py]
214--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000215
Fred Drake272fb3a1998-04-07 14:15:28 +0000216\item[sched.py]
217--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000218
Fred Drake272fb3a1998-04-07 14:15:28 +0000219\item[shutil.py]
220--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000221
Fred Drake272fb3a1998-04-07 14:15:28 +0000222\item[util.py]
223--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000224
Fred Drake272fb3a1998-04-07 14:15:28 +0000225\item[zmod.py]
226--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000227
Fred Drake272fb3a1998-04-07 14:15:28 +0000228\item[tzparse.py]
229--- Parse a timezone specification (unfinished)
230\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000231
232
233\section{Obsolete}
234
Fred Drake71c1e501998-04-04 07:03:19 +0000235These modules are not on the standard module search path;
236\indexiii{module}{search}{path}
237but are available in the directory \file{lib-old/} installed under
Fred Drake20ca9171998-04-09 14:32:28 +0000238\file{\textrm{\$prefix}/lib/python1.5/}. To use any of these
Fred Drake71c1e501998-04-04 07:03:19 +0000239modules, add that directory to \code{sys.path}, possibly using
240\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000241
Fred Drake272fb3a1998-04-07 14:15:28 +0000242\begin{description}
243\item[newdir.py]
244--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000245
Fred Drake272fb3a1998-04-07 14:15:28 +0000246\item[addpack.py]
247--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000248
Fred Drake272fb3a1998-04-07 14:15:28 +0000249\item[fmt.py]
250--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000251
Fred Drake272fb3a1998-04-07 14:15:28 +0000252\item[Para.py]
253--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000254
Fred Drake272fb3a1998-04-07 14:15:28 +0000255\item[lockfile.py]
256--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000257fcntl.lockf/flock intead)
258
Fred Drake272fb3a1998-04-07 14:15:28 +0000259\item[tb.py]
260--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000261pdb.pm() or traceback.py instead)
262
Fred Drake272fb3a1998-04-07 14:15:28 +0000263\item[codehack.py]
264--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000265code object (these are now accessible as attributes: co.co_name,
266func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000267\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000268
Fred Drake20ca9171998-04-09 14:32:28 +0000269The following modules were documented in previous versions of this
270manual, but are now considered obsolete:
271
272\begin{description}
273\item[ni]
274--- Import modules in ``packages.''
275
276\item[rand]
277--- Old interface to the random number generator.
278
279\item[soundex]
280--- Algorithm for collapsing names which sound similar to a shared
281key. (This is an extension module.)
282\end{description}
283
Guido van Rossum612316f1997-03-14 04:12:52 +0000284
285\section{Extension modules}
286
Fred Drake272fb3a1998-04-07 14:15:28 +0000287\begin{description}
288\item[bsddbmodule.c]
289--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000290dbm clone).
291
Fred Drake272fb3a1998-04-07 14:15:28 +0000292\item[cursesmodule.c]
293--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000294
Fred Drake272fb3a1998-04-07 14:15:28 +0000295\item[dlmodule.c]
296--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000297arbitrary C functions in arbitrary shared libraries.
298
Fred Drake272fb3a1998-04-07 14:15:28 +0000299\item[newmodule.c]
300--- Tommy Burnette's `new' module (creates new empty objects of
301certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000302
Fred Drake272fb3a1998-04-07 14:15:28 +0000303\item[nismodule.c]
304--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000305
Fred Drake272fb3a1998-04-07 14:15:28 +0000306\item[timingmodule.c]
307--- Measure time intervals to high resolution (obsolete --- use
308time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000309
Fred Drake272fb3a1998-04-07 14:15:28 +0000310\item[stdwinmodule.c]
311--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000312platform-independent GUI package). Obsolete; use Tkinter for a
313platform-independent GUI instead.
314
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000315The following are SGI specific:
316
Fred Drake272fb3a1998-04-07 14:15:28 +0000317\item[clmodule.c]
318--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000319
Fred Drake272fb3a1998-04-07 14:15:28 +0000320\item[svmodule.c]
321--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000322(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000323
324The following is Windows specific:
325
Fred Drake272fb3a1998-04-07 14:15:28 +0000326\item[msvcrtmodule.c]
327(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000328specific goodies like \code{khbit()}, \code{getch()} and
329\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000330\end{description}