blob: e55259de82ae9b36732481122a257491bd2ff1e2 [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 Drake68fede71998-04-13 20:31:31 +000061\item[getpass.py]
62--- Utilities to get a password and/or the current user name.
63
Fred Drake272fb3a1998-04-07 14:15:28 +000064\item[linecache.py]
65--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000066
Fred Drake272fb3a1998-04-07 14:15:28 +000067\item[pipes.py]
68--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake272fb3a1998-04-07 14:15:28 +000070\item[statcache.py]
71--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000072
Fred Drake272fb3a1998-04-07 14:15:28 +000073\item[colorsys.py]
74--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000075
Fred Drake272fb3a1998-04-07 14:15:28 +000076\item[dbhash.py]
77--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000078
Fred Drake272fb3a1998-04-07 14:15:28 +000079\item[mhlib.py]
80--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000081
Fred Drake272fb3a1998-04-07 14:15:28 +000082\item[pty.py]
83--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000084
Fred Drake272fb3a1998-04-07 14:15:28 +000085\item[tty.py]
86--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000087
Fred Drake272fb3a1998-04-07 14:15:28 +000088\item[bdb.py]
89--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000090
Fred Drake6b9ff721998-04-07 19:09:32 +000091\item[wdb.py]
92--- A primitive windowing debugger based on STDWIN.
93
Fred Drake272fb3a1998-04-07 14:15:28 +000094\item[ihooks.py]
95--- Import hook support (for rexec)
Fred Drake272fb3a1998-04-07 14:15:28 +000096\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000097
Guido van Rossum90858221997-08-15 02:52:46 +000098
Guido van Rossum612316f1997-03-14 04:12:52 +000099\section{Parsing Python}
100
101(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000102parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000103
Fred Drake272fb3a1998-04-07 14:15:28 +0000104\begin{description}
105\item[tokenize.py]
106--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000107contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000108
Fred Drake272fb3a1998-04-07 14:15:28 +0000109\item[pyclbr.py]
110--- Parse a Python file and retrieve classes and methods
111\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000112
113
114\section{Platform specific modules}
115
Fred Drake272fb3a1998-04-07 14:15:28 +0000116\begin{description}
117\item[ntpath.py]
118--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000119
Fred Drake272fb3a1998-04-07 14:15:28 +0000120\item[dospath.py]
121--- equivalent of posixpath on MS-DOS
122\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000123
Guido van Rossum612316f1997-03-14 04:12:52 +0000124
125\section{Code objects and files, debugger etc.}
126
Fred Drake272fb3a1998-04-07 14:15:28 +0000127\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000128\item[repr.py]
129--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000130sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000131\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000132
Guido van Rossum612316f1997-03-14 04:12:52 +0000133
134\section{Multimedia}
135
Fred Drake272fb3a1998-04-07 14:15:28 +0000136\begin{description}
137\item[audiodev.py]
138--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000139
Fred Drake272fb3a1998-04-07 14:15:28 +0000140\item[sunau.py]
141--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000142
Fred Drake272fb3a1998-04-07 14:15:28 +0000143\item[sunaudio.py]
144--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000145
Fred Drake272fb3a1998-04-07 14:15:28 +0000146\item[toaiff.py]
147--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000148
Fred Drake272fb3a1998-04-07 14:15:28 +0000149\item[sndhdr.py]
150--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000151
Fred Drake272fb3a1998-04-07 14:15:28 +0000152\item[wave.py]
153--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000154
Fred Drake272fb3a1998-04-07 14:15:28 +0000155\item[whatsound.py]
156--- recognizing sound files
157\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000158
159
160\section{Oddities}
161
162These modules are probably also obsolete, or just not very useful.
163
Fred Drake272fb3a1998-04-07 14:15:28 +0000164\begin{description}
165\item[dump.py]
166--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000167
Fred Drake272fb3a1998-04-07 14:15:28 +0000168\item[find.py]
169--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000170
Fred Drake272fb3a1998-04-07 14:15:28 +0000171\item[fpformat.py]
172--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000173interesting demonstration of how to do this without using the \C{}
174library
Guido van Rossum612316f1997-03-14 04:12:52 +0000175
Fred Drake272fb3a1998-04-07 14:15:28 +0000176\item[grep.py]
177--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000178
Fred Drake272fb3a1998-04-07 14:15:28 +0000179\item[mutex.py]
180--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000181
Fred Drake272fb3a1998-04-07 14:15:28 +0000182\item[packmail.py]
183--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000184
Fred Drake272fb3a1998-04-07 14:15:28 +0000185\item[sched.py]
186--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000187
Fred Drake272fb3a1998-04-07 14:15:28 +0000188\item[shutil.py]
189--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000190
Fred Drake272fb3a1998-04-07 14:15:28 +0000191\item[util.py]
192--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000193
Fred Drake272fb3a1998-04-07 14:15:28 +0000194\item[tzparse.py]
195--- Parse a timezone specification (unfinished)
196\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000197
198
199\section{Obsolete}
200
Fred Drake71c1e501998-04-04 07:03:19 +0000201These modules are not on the standard module search path;
202\indexiii{module}{search}{path}
203but are available in the directory \file{lib-old/} installed under
Fred Drake3700b6f1998-08-07 16:02:28 +0000204\file{\textrm{\$prefix}/lib/python1.5/}. % $ <-- bow to font lock
205To use any of these modules, add that directory to \code{sys.path},
206possibly using \envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000207
Fred Drake272fb3a1998-04-07 14:15:28 +0000208\begin{description}
209\item[newdir.py]
210--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000211
Fred Drake272fb3a1998-04-07 14:15:28 +0000212\item[addpack.py]
213--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000214
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000215\item[codehack.py]
216--- Extract function name or line number from a function
217code object (these are now accessible as attributes: co.co_name,
218func.func_name, co.co_firstlineno).
219
Fred Drake272fb3a1998-04-07 14:15:28 +0000220\item[fmt.py]
221--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000222
Fred Drake272fb3a1998-04-07 14:15:28 +0000223\item[Para.py]
224--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000225
Fred Drake272fb3a1998-04-07 14:15:28 +0000226\item[lockfile.py]
227--- wrapper around FCNTL file locking (use
Fred Drake3700b6f1998-08-07 16:02:28 +0000228\function{fcntl.lockf()}/\function{flock()} intead)
Guido van Rossum612316f1997-03-14 04:12:52 +0000229
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000230\item[poly.py]
231--- Polynomials
232
Fred Drake272fb3a1998-04-07 14:15:28 +0000233\item[tb.py]
234--- Print tracebacks, with a dump of local variables (use
Fred Drake3700b6f1998-08-07 16:02:28 +0000235\function{pdb.pm()} or \module{traceback} instead)
Guido van Rossum612316f1997-03-14 04:12:52 +0000236
Fred Drake3700b6f1998-08-07 16:02:28 +0000237\item[timingmodule]
238--- Measure time intervals to high resolution (use
239\function{time.clock()} instead). (This is an extension module.)
Fred Drake9ed1a0af1998-11-02 15:46:21 +0000240
241\item[zmod.py]
242--- Compute properties of mathematical "fields"
Fred Drake272fb3a1998-04-07 14:15:28 +0000243\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000244
Fred Drake20ca9171998-04-09 14:32:28 +0000245The following modules were documented in previous versions of this
246manual, but are now considered obsolete:
247
248\begin{description}
249\item[ni]
Fred Drake3700b6f1998-08-07 16:02:28 +0000250--- Import modules in ``packages.'' Basic package support is now
251built in.
Fred Drake20ca9171998-04-09 14:32:28 +0000252
253\item[rand]
254--- Old interface to the random number generator.
255
256\item[soundex]
257--- Algorithm for collapsing names which sound similar to a shared
258key. (This is an extension module.)
259\end{description}
260
Guido van Rossum612316f1997-03-14 04:12:52 +0000261
262\section{Extension modules}
263
Fred Drake272fb3a1998-04-07 14:15:28 +0000264\begin{description}
265\item[bsddbmodule.c]
266--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000267dbm clone).
268
Fred Drake272fb3a1998-04-07 14:15:28 +0000269\item[cursesmodule.c]
270--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000271
Fred Drake272fb3a1998-04-07 14:15:28 +0000272\item[dlmodule.c]
273--- A highly experimental and dangerous device for calling
Fred Drake3700b6f1998-08-07 16:02:28 +0000274arbitrary \C{} functions in arbitrary shared libraries.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000275
Fred Drake272fb3a1998-04-07 14:15:28 +0000276\item[newmodule.c]
Fred Drake3700b6f1998-08-07 16:02:28 +0000277--- Tommy Burnette's \module{new} module (creates new empty objects of
Fred Drake272fb3a1998-04-07 14:15:28 +0000278certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000279
Fred Drake272fb3a1998-04-07 14:15:28 +0000280\item[nismodule.c]
281--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000282
Fred Drake272fb3a1998-04-07 14:15:28 +0000283\item[stdwinmodule.c]
284--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000285platform-independent GUI package). Obsolete; use Tkinter for a
286platform-independent GUI instead.
Fred Drake3700b6f1998-08-07 16:02:28 +0000287\end{description}
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000288
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000289The following are SGI specific:
290
Fred Drake3700b6f1998-08-07 16:02:28 +0000291\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000292\item[clmodule.c]
293--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000294
Fred Drake272fb3a1998-04-07 14:15:28 +0000295\item[svmodule.c]
296--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000297(obsolete hardware).
Fred Drake3700b6f1998-08-07 16:02:28 +0000298\end{description}
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000299
300The following is Windows specific:
301
Fred Drake3700b6f1998-08-07 16:02:28 +0000302\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000303\item[msvcrtmodule.c]
304(in directory \file{PC/}) --- define a number of Windows
Fred Drake3700b6f1998-08-07 16:02:28 +0000305specific goodies like \function{khbit()}, \function{getch()} and
306\function{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000307\end{description}