blob: 8ca65d66cd38330baf7e7a808f9b20df522faf44 [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
25\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000026
Guido van Rossum612316f1997-03-14 04:12:52 +000027
28\section{Stuff useful to a lot of people, including the CGI crowd}
29
Fred Drake272fb3a1998-04-07 14:15:28 +000030\begin{description}
31\item[MimeWriter.py]
32--- Generic MIME writer
Fred Drake272fb3a1998-04-07 14:15:28 +000033\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000034
Guido van Rossum612316f1997-03-14 04:12:52 +000035
36\section{Miscellaneous useful utilities}
37
38Some of these are very old and/or not very robust; marked with ``hmm''.
39
Fred Drake272fb3a1998-04-07 14:15:28 +000040\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +000041\item[ConfigParser.py]
42--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000043
Fred Drake272fb3a1998-04-07 14:15:28 +000044\item[cmp.py]
45--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000046
Fred Drake272fb3a1998-04-07 14:15:28 +000047\item[cmpcache.py]
48--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000049
Fred Drake272fb3a1998-04-07 14:15:28 +000050\item[dircache.py]
51--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000052
Fred Drake272fb3a1998-04-07 14:15:28 +000053\item[dircmp.py]
54--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000055
Fred Drake68fede71998-04-13 20:31:31 +000056\item[getpass.py]
57--- Utilities to get a password and/or the current user name.
58
Fred Drake272fb3a1998-04-07 14:15:28 +000059\item[linecache.py]
60--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000061
Fred Drake272fb3a1998-04-07 14:15:28 +000062\item[pipes.py]
63--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000064
Fred Drake272fb3a1998-04-07 14:15:28 +000065\item[statcache.py]
66--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000067
Fred Drake272fb3a1998-04-07 14:15:28 +000068\item[colorsys.py]
69--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000070
Fred Drake272fb3a1998-04-07 14:15:28 +000071\item[dbhash.py]
72--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000073
Fred Drake272fb3a1998-04-07 14:15:28 +000074\item[mhlib.py]
75--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000076
Fred Drake272fb3a1998-04-07 14:15:28 +000077\item[pty.py]
78--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000079
Fred Drake272fb3a1998-04-07 14:15:28 +000080\item[tty.py]
81--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000082
Fred Drake272fb3a1998-04-07 14:15:28 +000083\item[bdb.py]
84--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000085
Fred Drake6b9ff721998-04-07 19:09:32 +000086\item[wdb.py]
87--- A primitive windowing debugger based on STDWIN.
88
Fred Drake272fb3a1998-04-07 14:15:28 +000089\item[ihooks.py]
90--- Import hook support (for rexec)
Fred Drake272fb3a1998-04-07 14:15:28 +000091\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000092
Guido van Rossum90858221997-08-15 02:52:46 +000093
Guido van Rossum612316f1997-03-14 04:12:52 +000094\section{Parsing Python}
95
96(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +000097parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +000098
Fred Drake272fb3a1998-04-07 14:15:28 +000099\begin{description}
100\item[tokenize.py]
101--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000102contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000103
Fred Drake272fb3a1998-04-07 14:15:28 +0000104\item[pyclbr.py]
105--- Parse a Python file and retrieve classes and methods
106\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000107
108
109\section{Platform specific modules}
110
Fred Drake272fb3a1998-04-07 14:15:28 +0000111\begin{description}
112\item[ntpath.py]
113--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000114
Fred Drake272fb3a1998-04-07 14:15:28 +0000115\item[dospath.py]
116--- equivalent of posixpath on MS-DOS
117\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000118
Guido van Rossum612316f1997-03-14 04:12:52 +0000119
120\section{Code objects and files, debugger etc.}
121
Fred Drake272fb3a1998-04-07 14:15:28 +0000122\begin{description}
123\item[compileall.py]
124--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000125
Fred Drake272fb3a1998-04-07 14:15:28 +0000126\item[py_compile.py]
127--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000128
Fred Drake272fb3a1998-04-07 14:15:28 +0000129\item[repr.py]
130--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000131sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000132\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000133
Guido van Rossum612316f1997-03-14 04:12:52 +0000134
135\section{Multimedia}
136
Fred Drake272fb3a1998-04-07 14:15:28 +0000137\begin{description}
138\item[audiodev.py]
139--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000140
Fred Drake272fb3a1998-04-07 14:15:28 +0000141\item[sunau.py]
142--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000143
Fred Drake272fb3a1998-04-07 14:15:28 +0000144\item[sunaudio.py]
145--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000146
Fred Drake272fb3a1998-04-07 14:15:28 +0000147\item[toaiff.py]
148--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
Fred Drake272fb3a1998-04-07 14:15:28 +0000150\item[sndhdr.py]
151--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000152
Fred Drake272fb3a1998-04-07 14:15:28 +0000153\item[wave.py]
154--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000155
Fred Drake272fb3a1998-04-07 14:15:28 +0000156\item[whatsound.py]
157--- recognizing sound files
158\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000159
160
161\section{Oddities}
162
163These modules are probably also obsolete, or just not very useful.
164
Fred Drake272fb3a1998-04-07 14:15:28 +0000165\begin{description}
166\item[dump.py]
167--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000168
Fred Drake272fb3a1998-04-07 14:15:28 +0000169\item[find.py]
170--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000171
Fred Drake272fb3a1998-04-07 14:15:28 +0000172\item[fpformat.py]
173--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000174interesting demonstration of how to do this without using the \C{}
175library
Guido van Rossum612316f1997-03-14 04:12:52 +0000176
Fred Drake272fb3a1998-04-07 14:15:28 +0000177\item[grep.py]
178--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000179
Fred Drake272fb3a1998-04-07 14:15:28 +0000180\item[mutex.py]
181--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000182
Fred Drake272fb3a1998-04-07 14:15:28 +0000183\item[packmail.py]
184--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000185
Fred Drake272fb3a1998-04-07 14:15:28 +0000186\item[poly.py]
187--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000188
Fred Drake272fb3a1998-04-07 14:15:28 +0000189\item[sched.py]
190--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000191
Fred Drake272fb3a1998-04-07 14:15:28 +0000192\item[shutil.py]
193--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000194
Fred Drake272fb3a1998-04-07 14:15:28 +0000195\item[util.py]
196--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000197
Fred Drake272fb3a1998-04-07 14:15:28 +0000198\item[zmod.py]
199--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000200
Fred Drake272fb3a1998-04-07 14:15:28 +0000201\item[tzparse.py]
202--- Parse a timezone specification (unfinished)
203\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000204
205
206\section{Obsolete}
207
Fred Drake71c1e501998-04-04 07:03:19 +0000208These modules are not on the standard module search path;
209\indexiii{module}{search}{path}
210but are available in the directory \file{lib-old/} installed under
Fred Drake20ca9171998-04-09 14:32:28 +0000211\file{\textrm{\$prefix}/lib/python1.5/}. To use any of these
Fred Drake71c1e501998-04-04 07:03:19 +0000212modules, add that directory to \code{sys.path}, possibly using
213\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000214
Fred Drake272fb3a1998-04-07 14:15:28 +0000215\begin{description}
216\item[newdir.py]
217--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000218
Fred Drake272fb3a1998-04-07 14:15:28 +0000219\item[addpack.py]
220--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000221
Fred Drake272fb3a1998-04-07 14:15:28 +0000222\item[fmt.py]
223--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000224
Fred Drake272fb3a1998-04-07 14:15:28 +0000225\item[Para.py]
226--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000227
Fred Drake272fb3a1998-04-07 14:15:28 +0000228\item[lockfile.py]
229--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000230fcntl.lockf/flock intead)
231
Fred Drake272fb3a1998-04-07 14:15:28 +0000232\item[tb.py]
233--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000234pdb.pm() or traceback.py instead)
235
Fred Drake272fb3a1998-04-07 14:15:28 +0000236\item[codehack.py]
237--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000238code object (these are now accessible as attributes: co.co_name,
239func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000240\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000241
Fred Drake20ca9171998-04-09 14:32:28 +0000242The following modules were documented in previous versions of this
243manual, but are now considered obsolete:
244
245\begin{description}
246\item[ni]
247--- Import modules in ``packages.''
248
249\item[rand]
250--- Old interface to the random number generator.
251
252\item[soundex]
253--- Algorithm for collapsing names which sound similar to a shared
254key. (This is an extension module.)
255\end{description}
256
Guido van Rossum612316f1997-03-14 04:12:52 +0000257
258\section{Extension modules}
259
Fred Drake272fb3a1998-04-07 14:15:28 +0000260\begin{description}
261\item[bsddbmodule.c]
262--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000263dbm clone).
264
Fred Drake272fb3a1998-04-07 14:15:28 +0000265\item[cursesmodule.c]
266--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000267
Fred Drake272fb3a1998-04-07 14:15:28 +0000268\item[dlmodule.c]
269--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000270arbitrary C functions in arbitrary shared libraries.
271
Fred Drake272fb3a1998-04-07 14:15:28 +0000272\item[newmodule.c]
273--- Tommy Burnette's `new' module (creates new empty objects of
274certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000275
Fred Drake272fb3a1998-04-07 14:15:28 +0000276\item[nismodule.c]
277--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000278
Fred Drake272fb3a1998-04-07 14:15:28 +0000279\item[timingmodule.c]
280--- Measure time intervals to high resolution (obsolete --- use
281time.clock() instead).
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.
287
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000288The following are SGI specific:
289
Fred Drake272fb3a1998-04-07 14:15:28 +0000290\item[clmodule.c]
291--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000292
Fred Drake272fb3a1998-04-07 14:15:28 +0000293\item[svmodule.c]
294--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000295(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000296
297The following is Windows specific:
298
Fred Drake272fb3a1998-04-07 14:15:28 +0000299\item[msvcrtmodule.c]
300(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000301specific goodies like \code{khbit()}, \code{getch()} and
302\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000303\end{description}