blob: d60abc0d58e340591d232e9e44c9c95102652de8 [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[cmp.py]
47--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000048
Fred Drake272fb3a1998-04-07 14:15:28 +000049\item[cmpcache.py]
50--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000051
Fred Drake272fb3a1998-04-07 14:15:28 +000052\item[dircache.py]
53--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000054
Fred Drake272fb3a1998-04-07 14:15:28 +000055\item[dircmp.py]
56--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000057
Fred Drake272fb3a1998-04-07 14:15:28 +000058\item[linecache.py]
59--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000060
Fred Drake272fb3a1998-04-07 14:15:28 +000061\item[pipes.py]
62--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000063
Fred Drake272fb3a1998-04-07 14:15:28 +000064\item[statcache.py]
65--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000066
Fred Drake272fb3a1998-04-07 14:15:28 +000067\item[colorsys.py]
68--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake272fb3a1998-04-07 14:15:28 +000070\item[dbhash.py]
71--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000072
Fred Drake272fb3a1998-04-07 14:15:28 +000073\item[mhlib.py]
74--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000075
Fred Drake272fb3a1998-04-07 14:15:28 +000076\item[pty.py]
77--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000078
Fred Drake272fb3a1998-04-07 14:15:28 +000079\item[tty.py]
80--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000081
Fred Drake272fb3a1998-04-07 14:15:28 +000082\item[bdb.py]
83--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000084
Fred Drake6b9ff721998-04-07 19:09:32 +000085\item[wdb.py]
86--- A primitive windowing debugger based on STDWIN.
87
Fred Drake272fb3a1998-04-07 14:15:28 +000088\item[ihooks.py]
89--- Import hook support (for rexec)
Fred Drake272fb3a1998-04-07 14:15:28 +000090\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000091
Guido van Rossum90858221997-08-15 02:52:46 +000092
Guido van Rossum612316f1997-03-14 04:12:52 +000093\section{Parsing Python}
94
95(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +000096parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +000097
Fred Drake272fb3a1998-04-07 14:15:28 +000098\begin{description}
99\item[tokenize.py]
100--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000101contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000102
Fred Drake272fb3a1998-04-07 14:15:28 +0000103\item[pyclbr.py]
104--- Parse a Python file and retrieve classes and methods
105\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000106
107
108\section{Platform specific modules}
109
Fred Drake272fb3a1998-04-07 14:15:28 +0000110\begin{description}
111\item[ntpath.py]
112--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000113
Fred Drake272fb3a1998-04-07 14:15:28 +0000114\item[dospath.py]
115--- equivalent of posixpath on MS-DOS
116\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000117
Guido van Rossum612316f1997-03-14 04:12:52 +0000118
Guido van Rossum612316f1997-03-14 04:12:52 +0000119\section{Multimedia}
120
Fred Drake272fb3a1998-04-07 14:15:28 +0000121\begin{description}
122\item[audiodev.py]
123--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000124
Fred Drake272fb3a1998-04-07 14:15:28 +0000125\item[sunau.py]
126--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000127
Fred Drake272fb3a1998-04-07 14:15:28 +0000128\item[sunaudio.py]
129--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000130
Fred Drake272fb3a1998-04-07 14:15:28 +0000131\item[toaiff.py]
132--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000133
Fred Drake272fb3a1998-04-07 14:15:28 +0000134\item[wave.py]
135--- parse WAVE files
Fred Drake272fb3a1998-04-07 14:15:28 +0000136\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000137
138
139\section{Oddities}
140
141These modules are probably also obsolete, or just not very useful.
142
Fred Drake272fb3a1998-04-07 14:15:28 +0000143\begin{description}
144\item[dump.py]
145--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000146
Fred Drake272fb3a1998-04-07 14:15:28 +0000147\item[find.py]
148--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
Fred Drake272fb3a1998-04-07 14:15:28 +0000150\item[fpformat.py]
151--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000152interesting demonstration of how to do this without using the \C{}
153library
Guido van Rossum612316f1997-03-14 04:12:52 +0000154
Fred Drake272fb3a1998-04-07 14:15:28 +0000155\item[grep.py]
156--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000157
Fred Drake272fb3a1998-04-07 14:15:28 +0000158\item[mutex.py]
159--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000160
Fred Drake272fb3a1998-04-07 14:15:28 +0000161\item[packmail.py]
162--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000163
Fred Drake272fb3a1998-04-07 14:15:28 +0000164\item[sched.py]
165--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000166
Fred Drake272fb3a1998-04-07 14:15:28 +0000167\item[util.py]
168--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000169
Fred Drake272fb3a1998-04-07 14:15:28 +0000170\item[tzparse.py]
171--- Parse a timezone specification (unfinished)
172\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000173
174
175\section{Obsolete}
176
Fred Drake71c1e501998-04-04 07:03:19 +0000177These modules are not on the standard module search path;
178\indexiii{module}{search}{path}
179but are available in the directory \file{lib-old/} installed under
Fred Drake3700b6f1998-08-07 16:02:28 +0000180\file{\textrm{\$prefix}/lib/python1.5/}. % $ <-- bow to font lock
181To use any of these modules, add that directory to \code{sys.path},
182possibly using \envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000183
Fred Drake272fb3a1998-04-07 14:15:28 +0000184\begin{description}
185\item[newdir.py]
186--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000187
Fred Drake272fb3a1998-04-07 14:15:28 +0000188\item[addpack.py]
189--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000190
Fred Drake9ed1a0a1998-11-02 15:46:21 +0000191\item[codehack.py]
192--- Extract function name or line number from a function
193code object (these are now accessible as attributes: co.co_name,
194func.func_name, co.co_firstlineno).
195
Fred Drake272fb3a1998-04-07 14:15:28 +0000196\item[fmt.py]
197--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000198
Fred Drake272fb3a1998-04-07 14:15:28 +0000199\item[Para.py]
200--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000201
Fred Drake272fb3a1998-04-07 14:15:28 +0000202\item[lockfile.py]
203--- wrapper around FCNTL file locking (use
Fred Drake3700b6f1998-08-07 16:02:28 +0000204\function{fcntl.lockf()}/\function{flock()} intead)
Guido van Rossum612316f1997-03-14 04:12:52 +0000205
Fred Drake9ed1a0a1998-11-02 15:46:21 +0000206\item[poly.py]
207--- Polynomials
208
Fred Drake272fb3a1998-04-07 14:15:28 +0000209\item[tb.py]
210--- Print tracebacks, with a dump of local variables (use
Fred Drakee36e4e61999-01-13 17:11:52 +0000211\function{pdb.pm()} or \refmodule{traceback} instead)
Guido van Rossum612316f1997-03-14 04:12:52 +0000212
Fred Drake3700b6f1998-08-07 16:02:28 +0000213\item[timingmodule]
214--- Measure time intervals to high resolution (use
215\function{time.clock()} instead). (This is an extension module.)
Fred Drake9ed1a0a1998-11-02 15:46:21 +0000216
Fred Drake60adb361999-01-05 23:09:12 +0000217\item[whatsound.py]
Fred Drakee36e4e61999-01-13 17:11:52 +0000218--- Recognize sound files; use \refmodule{sndhdr} instead.
Fred Drake60adb361999-01-05 23:09:12 +0000219
Fred Drake9ed1a0a1998-11-02 15:46:21 +0000220\item[zmod.py]
221--- Compute properties of mathematical "fields"
Fred Drake272fb3a1998-04-07 14:15:28 +0000222\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000223
Fred Drake20ca9171998-04-09 14:32:28 +0000224The following modules were documented in previous versions of this
225manual, but are now considered obsolete:
226
227\begin{description}
228\item[ni]
Fred Drake3700b6f1998-08-07 16:02:28 +0000229--- Import modules in ``packages.'' Basic package support is now
230built in.
Fred Drake20ca9171998-04-09 14:32:28 +0000231
232\item[rand]
233--- Old interface to the random number generator.
234
235\item[soundex]
236--- Algorithm for collapsing names which sound similar to a shared
237key. (This is an extension module.)
238\end{description}
239
Guido van Rossum612316f1997-03-14 04:12:52 +0000240
241\section{Extension modules}
242
Fred Drake272fb3a1998-04-07 14:15:28 +0000243\begin{description}
244\item[bsddbmodule.c]
245--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000246dbm clone).
247
Fred Drake272fb3a1998-04-07 14:15:28 +0000248\item[cursesmodule.c]
249--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000250
Fred Drake272fb3a1998-04-07 14:15:28 +0000251\item[dlmodule.c]
252--- A highly experimental and dangerous device for calling
Fred Drake3700b6f1998-08-07 16:02:28 +0000253arbitrary \C{} functions in arbitrary shared libraries.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000254
Fred Drake272fb3a1998-04-07 14:15:28 +0000255\item[newmodule.c]
Fred Drake3700b6f1998-08-07 16:02:28 +0000256--- Tommy Burnette's \module{new} module (creates new empty objects of
Fred Drake272fb3a1998-04-07 14:15:28 +0000257certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000258
Fred Drake272fb3a1998-04-07 14:15:28 +0000259\item[nismodule.c]
260--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000261
Fred Drake272fb3a1998-04-07 14:15:28 +0000262\item[stdwinmodule.c]
263--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000264platform-independent GUI package). Obsolete; use Tkinter for a
265platform-independent GUI instead.
Fred Drake3700b6f1998-08-07 16:02:28 +0000266\end{description}
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000267
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000268The following are SGI specific:
269
Fred Drake3700b6f1998-08-07 16:02:28 +0000270\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000271\item[clmodule.c]
272--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000273
Fred Drake272fb3a1998-04-07 14:15:28 +0000274\item[svmodule.c]
275--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000276(obsolete hardware).
Fred Drake3700b6f1998-08-07 16:02:28 +0000277\end{description}
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000278
279The following is Windows specific:
280
Fred Drake3700b6f1998-08-07 16:02:28 +0000281\begin{description}
Fred Drake272fb3a1998-04-07 14:15:28 +0000282\item[msvcrtmodule.c]
283(in directory \file{PC/}) --- define a number of Windows
Fred Drake3700b6f1998-08-07 16:02:28 +0000284specific goodies like \function{khbit()}, \function{getch()} and
285\function{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000286\end{description}