blob: 44204684e46b88e3d60f318d72ef3fdd090b6e53 [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
Fred Drake211f22c1998-08-11 18:13:31 +000025
26\item[test]
27--- Regression testing framework. This is used for the Python
28regression test, but is useful for other Python libraries as well.
29This is a package rather than a module.
Fred Drake272fb3a1998-04-07 14:15:28 +000030\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000031
Guido van Rossum612316f1997-03-14 04:12:52 +000032
33\section{Stuff useful to a lot of people, including the CGI crowd}
34
Fred Drake272fb3a1998-04-07 14:15:28 +000035\begin{description}
36\item[MimeWriter.py]
37--- Generic MIME writer
Fred Drake272fb3a1998-04-07 14:15:28 +000038\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000039
Guido van Rossum612316f1997-03-14 04:12:52 +000040
41\section{Miscellaneous useful utilities}
42
43Some of these are very old and/or not very robust; marked with ``hmm''.
44
Fred Drake272fb3a1998-04-07 14:15:28 +000045\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +000046\item[ConfigParser.py]
47--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000048
Fred Drake272fb3a1998-04-07 14:15:28 +000049\item[cmp.py]
50--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000051
Fred Drake272fb3a1998-04-07 14:15:28 +000052\item[cmpcache.py]
53--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000054
Fred Drake272fb3a1998-04-07 14:15:28 +000055\item[dircache.py]
56--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000057
Fred Drake272fb3a1998-04-07 14:15:28 +000058\item[dircmp.py]
59--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000060
Fred Drake272fb3a1998-04-07 14:15:28 +000061\item[linecache.py]
62--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000063
Fred Drake272fb3a1998-04-07 14:15:28 +000064\item[pipes.py]
65--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000066
Fred Drake272fb3a1998-04-07 14:15:28 +000067\item[statcache.py]
68--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake272fb3a1998-04-07 14:15:28 +000070\item[colorsys.py]
71--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000072
Fred Drake272fb3a1998-04-07 14:15:28 +000073\item[dbhash.py]
74--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000075
Fred Drake272fb3a1998-04-07 14:15:28 +000076\item[mhlib.py]
77--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000078
Fred Drake272fb3a1998-04-07 14:15:28 +000079\item[pty.py]
80--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000081
Fred Drake272fb3a1998-04-07 14:15:28 +000082\item[tty.py]
83--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000084
Fred Drake272fb3a1998-04-07 14:15:28 +000085\item[bdb.py]
86--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000087
Fred Drake6b9ff721998-04-07 19:09:32 +000088\item[wdb.py]
89--- A primitive windowing debugger based on STDWIN.
90
Fred Drake272fb3a1998-04-07 14:15:28 +000091\item[ihooks.py]
92--- Import hook support (for rexec)
Fred Drake272fb3a1998-04-07 14:15:28 +000093\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000094
Guido van Rossum90858221997-08-15 02:52:46 +000095
Guido van Rossum612316f1997-03-14 04:12:52 +000096\section{Parsing Python}
97
98(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +000099parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000100
Fred Drake272fb3a1998-04-07 14:15:28 +0000101\begin{description}
102\item[tokenize.py]
103--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000104contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000105
Fred Drake272fb3a1998-04-07 14:15:28 +0000106\item[pyclbr.py]
107--- Parse a Python file and retrieve classes and methods
108\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000109
110
111\section{Platform specific modules}
112
Fred Drake272fb3a1998-04-07 14:15:28 +0000113\begin{description}
114\item[ntpath.py]
115--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000116
Fred Drake272fb3a1998-04-07 14:15:28 +0000117\item[dospath.py]
118--- equivalent of posixpath on MS-DOS
119\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000120
Guido van Rossum612316f1997-03-14 04:12:52 +0000121
122\section{Code objects and files, debugger etc.}
123
Fred Drake272fb3a1998-04-07 14:15:28 +0000124\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000125\item[repr.py]
126--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000127sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000128\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000129
Guido van Rossum612316f1997-03-14 04:12:52 +0000130
131\section{Multimedia}
132
Fred Drake272fb3a1998-04-07 14:15:28 +0000133\begin{description}
134\item[audiodev.py]
135--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000136
Fred Drake272fb3a1998-04-07 14:15:28 +0000137\item[sunau.py]
138--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000139
Fred Drake272fb3a1998-04-07 14:15:28 +0000140\item[sunaudio.py]
141--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000142
Fred Drake272fb3a1998-04-07 14:15:28 +0000143\item[toaiff.py]
144--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000145
Fred Drake272fb3a1998-04-07 14:15:28 +0000146\item[wave.py]
147--- parse WAVE files
Fred Drake272fb3a1998-04-07 14:15:28 +0000148\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
150
151\section{Oddities}
152
153These modules are probably also obsolete, or just not very useful.
154
Fred Drake272fb3a1998-04-07 14:15:28 +0000155\begin{description}
156\item[dump.py]
157--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000158
Fred Drake272fb3a1998-04-07 14:15:28 +0000159\item[find.py]
160--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000161
Fred Drake272fb3a1998-04-07 14:15:28 +0000162\item[fpformat.py]
163--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000164interesting demonstration of how to do this without using the \C{}
165library
Guido van Rossum612316f1997-03-14 04:12:52 +0000166
Fred Drake272fb3a1998-04-07 14:15:28 +0000167\item[grep.py]
168--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000169
Fred Drake272fb3a1998-04-07 14:15:28 +0000170\item[mutex.py]
171--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000172
Fred Drake272fb3a1998-04-07 14:15:28 +0000173\item[packmail.py]
174--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000175
Fred Drake272fb3a1998-04-07 14:15:28 +0000176\item[sched.py]
177--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000178
Fred Drake272fb3a1998-04-07 14:15:28 +0000179\item[util.py]
180--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000181
Fred Drake272fb3a1998-04-07 14:15:28 +0000182\item[tzparse.py]
183--- Parse a timezone specification (unfinished)
184\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000185
186
187\section{Obsolete}
188
Fred Drake71c1e501998-04-04 07:03:19 +0000189These modules are not on the standard module search path;
190\indexiii{module}{search}{path}
191but are available in the directory \file{lib-old/} installed under
Fred Drake3700b6f1998-08-07 16:02:28 +0000192\file{\textrm{\$prefix}/lib/python1.5/}. % $ <-- bow to font lock
193To use any of these modules, add that directory to \code{sys.path},
194possibly using \envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000195
Fred Drake272fb3a1998-04-07 14:15:28 +0000196\begin{description}
197\item[newdir.py]
198--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000199
Fred Drake272fb3a1998-04-07 14:15:28 +0000200\item[addpack.py]
201--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000202
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000203\item[codehack.py]
204--- Extract function name or line number from a function
205code object (these are now accessible as attributes: co.co_name,
206func.func_name, co.co_firstlineno).
207
Fred Drake272fb3a1998-04-07 14:15:28 +0000208\item[fmt.py]
209--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000210
Fred Drake272fb3a1998-04-07 14:15:28 +0000211\item[Para.py]
212--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000213
Fred Drake272fb3a1998-04-07 14:15:28 +0000214\item[lockfile.py]
215--- wrapper around FCNTL file locking (use
Fred Drake3700b6f1998-08-07 16:02:28 +0000216\function{fcntl.lockf()}/\function{flock()} intead)
Guido van Rossum612316f1997-03-14 04:12:52 +0000217
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000218\item[poly.py]
219--- Polynomials
220
Fred Drake272fb3a1998-04-07 14:15:28 +0000221\item[tb.py]
222--- Print tracebacks, with a dump of local variables (use
Fred Drakee36e4e61999-01-13 17:11:52 +0000223\function{pdb.pm()} or \refmodule{traceback} instead)
Guido van Rossum612316f1997-03-14 04:12:52 +0000224
Fred Drake3700b6f1998-08-07 16:02:28 +0000225\item[timingmodule]
226--- Measure time intervals to high resolution (use
227\function{time.clock()} instead). (This is an extension module.)
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000228
Fred Drake60adb361999-01-05 23:09:12 +0000229\item[whatsound.py]
Fred Drakee36e4e61999-01-13 17:11:52 +0000230--- Recognize sound files; use \refmodule{sndhdr} instead.
Fred Drake60adb361999-01-05 23:09:12 +0000231
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000232\item[zmod.py]
233--- Compute properties of mathematical "fields"
Fred Drake272fb3a1998-04-07 14:15:28 +0000234\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000235
Fred Drake20ca9171998-04-09 14:32:28 +0000236The following modules were documented in previous versions of this
237manual, but are now considered obsolete:
238
239\begin{description}
240\item[ni]
Fred Drake3700b6f1998-08-07 16:02:28 +0000241--- Import modules in ``packages.'' Basic package support is now
242built in.
Fred Drake20ca9171998-04-09 14:32:28 +0000243
244\item[rand]
245--- Old interface to the random number generator.
246
247\item[soundex]
248--- Algorithm for collapsing names which sound similar to a shared
249key. (This is an extension module.)
250\end{description}
251
Guido van Rossum612316f1997-03-14 04:12:52 +0000252
253\section{Extension modules}
254
Fred Drake272fb3a1998-04-07 14:15:28 +0000255\begin{description}
256\item[bsddbmodule.c]
257--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000258dbm clone).
259
Fred Drake272fb3a1998-04-07 14:15:28 +0000260\item[cursesmodule.c]
261--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000262
Fred Drake272fb3a1998-04-07 14:15:28 +0000263\item[dlmodule.c]
264--- A highly experimental and dangerous device for calling
Fred Drake3700b6f1998-08-07 16:02:28 +0000265arbitrary \C{} functions in arbitrary shared libraries.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000266
Fred Drake272fb3a1998-04-07 14:15:28 +0000267\item[newmodule.c]
Fred Drake3700b6f1998-08-07 16:02:28 +0000268--- Tommy Burnette's \module{new} module (creates new empty objects of
Fred Drake272fb3a1998-04-07 14:15:28 +0000269certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000270
Fred Drake272fb3a1998-04-07 14:15:28 +0000271\item[nismodule.c]
272--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000273
Fred Drake272fb3a1998-04-07 14:15:28 +0000274\item[stdwinmodule.c]
275--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000276platform-independent GUI package). Obsolete; use Tkinter for a
277platform-independent GUI instead.
Fred Drake3700b6f1998-08-07 16:02:28 +0000278\end{description}
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000279
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000280The following are SGI specific:
281
Fred Drake3700b6f1998-08-07 16:02:28 +0000282\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000283\item[clmodule.c]
284--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000285
Fred Drake272fb3a1998-04-07 14:15:28 +0000286\item[svmodule.c]
287--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000288(obsolete hardware).
Fred Drake3700b6f1998-08-07 16:02:28 +0000289\end{description}
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000290
291The following is Windows specific:
292
Fred Drake3700b6f1998-08-07 16:02:28 +0000293\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000294\item[msvcrtmodule.c]
295(in directory \file{PC/}) --- define a number of Windows
Fred Drake3700b6f1998-08-07 16:02:28 +0000296specific goodies like \function{khbit()}, \function{getch()} and
297\function{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000298\end{description}