blob: 99386fe513d1ecd47d764de9f3e443f021508f74 [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 Drake272fb3a1998-04-07 14:15:28 +000017\item[CGIHTTPServer.py]
18--- CGI-savvy HTTP Server
Guido van Rossum612316f1997-03-14 04:12:52 +000019
Fred Drake272fb3a1998-04-07 14:15:28 +000020\item[SimpleHTTPServer.py]
21--- Simple HTTP Server
22\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +000023
Guido van Rossum612316f1997-03-14 04:12:52 +000024
25\section{Stuff useful to a lot of people, including the CGI crowd}
26
Fred Drake272fb3a1998-04-07 14:15:28 +000027\begin{description}
28\item[MimeWriter.py]
29--- Generic MIME writer
Guido van Rossum612316f1997-03-14 04:12:52 +000030
Fred Drake272fb3a1998-04-07 14:15:28 +000031\item[multifile.py]
32--- make each part of a multipart message ``feel'' like
33
34\item[poplib.py]
35--- Post Office Protocol client by Dave Ascher.
Fred Drake007bac31998-04-09 18:54:01 +000036
37\item[smtplib.py]
38--- Simple Mail Transfer Protocol (SMTP) client code.
Fred Drake272fb3a1998-04-07 14:15:28 +000039\end{description}
Guido van Rossum00f15691997-11-24 17:50:09 +000040
Guido van Rossum612316f1997-03-14 04:12:52 +000041
42\section{Miscellaneous useful utilities}
43
44Some of these are very old and/or not very robust; marked with ``hmm''.
45
Fred Drake272fb3a1998-04-07 14:15:28 +000046\begin{description}
47\item[calendar.py]
48--- Calendar printing functions
Guido van Rossum612316f1997-03-14 04:12:52 +000049
Fred Drake272fb3a1998-04-07 14:15:28 +000050\item[ConfigParser.py]
51--- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000052
Fred Drake272fb3a1998-04-07 14:15:28 +000053\item[cmp.py]
54--- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000055
Fred Drake272fb3a1998-04-07 14:15:28 +000056\item[cmpcache.py]
57--- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000058
Fred Drake272fb3a1998-04-07 14:15:28 +000059\item[dircache.py]
60--- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000061
Fred Drake272fb3a1998-04-07 14:15:28 +000062\item[dircmp.py]
63--- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000064
Fred Drake272fb3a1998-04-07 14:15:28 +000065\item[linecache.py]
66--- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000067
Fred Drake272fb3a1998-04-07 14:15:28 +000068\item[pipes.py]
69--- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000070
Fred Drake272fb3a1998-04-07 14:15:28 +000071\item[popen2.py]
72--- improved popen, can read AND write simultaneously
Guido van Rossum612316f1997-03-14 04:12:52 +000073
Fred Drake272fb3a1998-04-07 14:15:28 +000074\item[statcache.py]
75--- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000076
Fred Drake272fb3a1998-04-07 14:15:28 +000077\item[colorsys.py]
78--- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000079
Fred Drake272fb3a1998-04-07 14:15:28 +000080\item[dbhash.py]
81--- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000082
Fred Drake272fb3a1998-04-07 14:15:28 +000083\item[mhlib.py]
84--- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000085
Fred Drake272fb3a1998-04-07 14:15:28 +000086\item[pty.py]
87--- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000088
Fred Drake272fb3a1998-04-07 14:15:28 +000089\item[tty.py]
90--- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000091
Fred Drake272fb3a1998-04-07 14:15:28 +000092\item[cmd.py]
93--- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000094
Fred Drake272fb3a1998-04-07 14:15:28 +000095\item[bdb.py]
96--- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000097
Fred Drake6b9ff721998-04-07 19:09:32 +000098\item[wdb.py]
99--- A primitive windowing debugger based on STDWIN.
100
Fred Drake272fb3a1998-04-07 14:15:28 +0000101\item[ihooks.py]
102--- Import hook support (for rexec)
Fred Drake71c1e501998-04-04 07:03:19 +0000103
Fred Drake272fb3a1998-04-07 14:15:28 +0000104\item[bisect.py]
105--- Bisection algorithms (this is actually useful at times,
Fred Drake71c1e501998-04-04 07:03:19 +0000106especially as reference material)
Fred Drake272fb3a1998-04-07 14:15:28 +0000107\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000108
Guido van Rossum90858221997-08-15 02:52:46 +0000109
Guido van Rossum612316f1997-03-14 04:12:52 +0000110\section{Parsing Python}
111
112(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +0000113parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000114
Fred Drake272fb3a1998-04-07 14:15:28 +0000115\begin{description}
116\item[tokenize.py]
117--- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +0000118contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +0000119
Fred Drake272fb3a1998-04-07 14:15:28 +0000120\item[pyclbr.py]
121--- Parse a Python file and retrieve classes and methods
122\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000123
124
125\section{Platform specific modules}
126
Fred Drake272fb3a1998-04-07 14:15:28 +0000127\begin{description}
128\item[ntpath.py]
129--- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +0000130
Fred Drake272fb3a1998-04-07 14:15:28 +0000131\item[dospath.py]
132--- equivalent of posixpath on MS-DOS
133\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000134
Guido van Rossum612316f1997-03-14 04:12:52 +0000135
136\section{Code objects and files, debugger etc.}
137
Fred Drake272fb3a1998-04-07 14:15:28 +0000138\begin{description}
139\item[compileall.py]
140--- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +0000141
Fred Drake272fb3a1998-04-07 14:15:28 +0000142\item[py_compile.py]
143--- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000144
Fred Drake272fb3a1998-04-07 14:15:28 +0000145\item[repr.py]
146--- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000147sizes (used by pdb)
Fred Drake272fb3a1998-04-07 14:15:28 +0000148\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000149
Guido van Rossum612316f1997-03-14 04:12:52 +0000150
151\section{Multimedia}
152
Fred Drake272fb3a1998-04-07 14:15:28 +0000153\begin{description}
154\item[audiodev.py]
155--- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000156
Fred Drake272fb3a1998-04-07 14:15:28 +0000157\item[sunau.py]
158--- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000159
Fred Drake272fb3a1998-04-07 14:15:28 +0000160\item[sunaudio.py]
161--- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000162
Fred Drake272fb3a1998-04-07 14:15:28 +0000163\item[toaiff.py]
164--- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000165
Fred Drake272fb3a1998-04-07 14:15:28 +0000166\item[sndhdr.py]
167--- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000168
Fred Drake272fb3a1998-04-07 14:15:28 +0000169\item[wave.py]
170--- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000171
Fred Drake272fb3a1998-04-07 14:15:28 +0000172\item[whatsound.py]
173--- recognizing sound files
174\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000175
176
177\section{Oddities}
178
179These modules are probably also obsolete, or just not very useful.
180
Fred Drake272fb3a1998-04-07 14:15:28 +0000181\begin{description}
182\item[dump.py]
183--- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000184
Fred Drake272fb3a1998-04-07 14:15:28 +0000185\item[find.py]
186--- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000187
Fred Drake272fb3a1998-04-07 14:15:28 +0000188\item[fpformat.py]
189--- General floating point formatting functions ---
Fred Drake71c1e501998-04-04 07:03:19 +0000190interesting demonstration of how to do this without using the \C{}
191library
Guido van Rossum612316f1997-03-14 04:12:52 +0000192
Fred Drake272fb3a1998-04-07 14:15:28 +0000193\item[grep.py]
194--- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000195
Fred Drake272fb3a1998-04-07 14:15:28 +0000196\item[mutex.py]
197--- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000198
Fred Drake272fb3a1998-04-07 14:15:28 +0000199\item[packmail.py]
200--- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000201
Fred Drake272fb3a1998-04-07 14:15:28 +0000202\item[poly.py]
203--- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000204
Fred Drake272fb3a1998-04-07 14:15:28 +0000205\item[sched.py]
206--- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000207
Fred Drake272fb3a1998-04-07 14:15:28 +0000208\item[shutil.py]
209--- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000210
Fred Drake272fb3a1998-04-07 14:15:28 +0000211\item[util.py]
212--- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000213
Fred Drake272fb3a1998-04-07 14:15:28 +0000214\item[zmod.py]
215--- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000216
Fred Drake272fb3a1998-04-07 14:15:28 +0000217\item[tzparse.py]
218--- Parse a timezone specification (unfinished)
219\end{description}
Guido van Rossum612316f1997-03-14 04:12:52 +0000220
221
222\section{Obsolete}
223
Fred Drake71c1e501998-04-04 07:03:19 +0000224These modules are not on the standard module search path;
225\indexiii{module}{search}{path}
226but are available in the directory \file{lib-old/} installed under
Fred Drake20ca9171998-04-09 14:32:28 +0000227\file{\textrm{\$prefix}/lib/python1.5/}. To use any of these
Fred Drake71c1e501998-04-04 07:03:19 +0000228modules, add that directory to \code{sys.path}, possibly using
229\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000230
Fred Drake272fb3a1998-04-07 14:15:28 +0000231\begin{description}
232\item[newdir.py]
233--- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000234
Fred Drake272fb3a1998-04-07 14:15:28 +0000235\item[addpack.py]
236--- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000237
Fred Drake272fb3a1998-04-07 14:15:28 +0000238\item[fmt.py]
239--- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000240
Fred Drake272fb3a1998-04-07 14:15:28 +0000241\item[Para.py]
242--- helper for fmt.py
Fred Drake71c1e501998-04-04 07:03:19 +0000243
Fred Drake272fb3a1998-04-07 14:15:28 +0000244\item[lockfile.py]
245--- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000246fcntl.lockf/flock intead)
247
Fred Drake272fb3a1998-04-07 14:15:28 +0000248\item[tb.py]
249--- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000250pdb.pm() or traceback.py instead)
251
Fred Drake272fb3a1998-04-07 14:15:28 +0000252\item[codehack.py]
253--- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000254code object (these are now accessible as attributes: co.co_name,
255func.func_name, co.co_firstlineno)
Fred Drake272fb3a1998-04-07 14:15:28 +0000256\end{description}
Guido van Rossum61c27031997-07-18 21:08:07 +0000257
Fred Drake20ca9171998-04-09 14:32:28 +0000258The following modules were documented in previous versions of this
259manual, but are now considered obsolete:
260
261\begin{description}
262\item[ni]
263--- Import modules in ``packages.''
264
265\item[rand]
266--- Old interface to the random number generator.
267
268\item[soundex]
269--- Algorithm for collapsing names which sound similar to a shared
270key. (This is an extension module.)
271\end{description}
272
Guido van Rossum612316f1997-03-14 04:12:52 +0000273
274\section{Extension modules}
275
Fred Drake272fb3a1998-04-07 14:15:28 +0000276\begin{description}
277\item[bsddbmodule.c]
278--- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000279dbm clone).
280
Fred Drake272fb3a1998-04-07 14:15:28 +0000281\item[cursesmodule.c]
282--- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000283
Fred Drake272fb3a1998-04-07 14:15:28 +0000284\item[dlmodule.c]
285--- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000286arbitrary C functions in arbitrary shared libraries.
287
Fred Drake272fb3a1998-04-07 14:15:28 +0000288\item[newmodule.c]
289--- Tommy Burnette's `new' module (creates new empty objects of
290certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000291
Fred Drake272fb3a1998-04-07 14:15:28 +0000292\item[nismodule.c]
293--- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000294
Fred Drake272fb3a1998-04-07 14:15:28 +0000295\item[timingmodule.c]
296--- Measure time intervals to high resolution (obsolete --- use
297time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000298
Fred Drake272fb3a1998-04-07 14:15:28 +0000299\item[stdwinmodule.c]
300--- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000301platform-independent GUI package). Obsolete; use Tkinter for a
302platform-independent GUI instead.
303
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000304The following are SGI specific:
305
Fred Drake272fb3a1998-04-07 14:15:28 +0000306\item[clmodule.c]
307--- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000308
Fred Drake272fb3a1998-04-07 14:15:28 +0000309\item[svmodule.c]
310--- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000311(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000312
313The following is Windows specific:
314
Fred Drake272fb3a1998-04-07 14:15:28 +0000315\item[msvcrtmodule.c]
316(in directory \file{PC/}) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000317specific goodies like \code{khbit()}, \code{getch()} and
318\code{setmode()}. (Windows 95 and NT only.)
Fred Drake272fb3a1998-04-07 14:15:28 +0000319\end{description}