blob: fc0683c05a9e47bf2353b00520f28155b50367b1 [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
10\section{Fundamental, and pretty straightforward to document}
11
Fred Drake71c1e501998-04-04 07:03:19 +000012cPickle.c --- mostly the same as pickle but no subclassing
Guido van Rossum08157f81997-08-21 02:29:19 +000013
Fred Drake71c1e501998-04-04 07:03:19 +000014cStringIO.c --- mostly the same as StringIO but no subclassing
Guido van Rossum08157f81997-08-21 02:29:19 +000015
Guido van Rossum612316f1997-03-14 04:12:52 +000016
Fred Drakea007c131997-12-29 21:32:26 +000017\section{Frameworks; somewhat harder to document, but well worth the effort}
Guido van Rossum612316f1997-03-14 04:12:52 +000018
Fred Drake71c1e501998-04-04 07:03:19 +000019Tkinter.py --- Interface to Tcl/Tk for graphical user interfaces;
Guido van Rossum15085381997-04-03 23:49:28 +000020Fredrik Lundh is working on this one!
Guido van Rossum612316f1997-03-14 04:12:52 +000021
Fred Drake71c1e501998-04-04 07:03:19 +000022CGIHTTPServer.py --- CGI-savvy HTTP Server
Guido van Rossum612316f1997-03-14 04:12:52 +000023
Fred Drake71c1e501998-04-04 07:03:19 +000024SimpleHTTPServer.py --- Simple HTTP Server
Guido van Rossum612316f1997-03-14 04:12:52 +000025
Guido van Rossum612316f1997-03-14 04:12:52 +000026
27\section{Stuff useful to a lot of people, including the CGI crowd}
28
Fred Drake71c1e501998-04-04 07:03:19 +000029MimeWriter.py --- Generic MIME writer
Guido van Rossum612316f1997-03-14 04:12:52 +000030
Fred Drake71c1e501998-04-04 07:03:19 +000031multifile.py --- make each part of a multipart message ``feel'' like
Guido van Rossum00f15691997-11-24 17:50:09 +000032
Guido van Rossum612316f1997-03-14 04:12:52 +000033
34\section{Miscellaneous useful utilities}
35
36Some of these are very old and/or not very robust; marked with ``hmm''.
37
Fred Drake71c1e501998-04-04 07:03:19 +000038calendar.py --- Calendar printing functions
Guido van Rossum612316f1997-03-14 04:12:52 +000039
Fred Drake71c1e501998-04-04 07:03:19 +000040ConfigParser.py --- Parse a file of sectioned configuration parameters
Guido van Rossum5de1eb91997-12-30 04:41:56 +000041
Fred Drake71c1e501998-04-04 07:03:19 +000042cmp.py --- Efficiently compare files
Guido van Rossum612316f1997-03-14 04:12:52 +000043
Fred Drake71c1e501998-04-04 07:03:19 +000044cmpcache.py --- Efficiently compare files (uses statcache)
Guido van Rossum612316f1997-03-14 04:12:52 +000045
Fred Drake71c1e501998-04-04 07:03:19 +000046dircache.py --- like os.listdir, but caches results
Guido van Rossum612316f1997-03-14 04:12:52 +000047
Fred Drake71c1e501998-04-04 07:03:19 +000048dircmp.py --- class to build directory diff tools on
Guido van Rossum612316f1997-03-14 04:12:52 +000049
Fred Drake71c1e501998-04-04 07:03:19 +000050linecache.py --- Cache lines from files (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000051
Fred Drake71c1e501998-04-04 07:03:19 +000052pipes.py --- Conversion pipeline templates (hmm)
Guido van Rossum612316f1997-03-14 04:12:52 +000053
Fred Drake71c1e501998-04-04 07:03:19 +000054popen2.py --- improved popen, can read AND write simultaneously
Guido van Rossum612316f1997-03-14 04:12:52 +000055
Fred Drake71c1e501998-04-04 07:03:19 +000056statcache.py --- Maintain a cache of file stats
Guido van Rossum612316f1997-03-14 04:12:52 +000057
Fred Drake71c1e501998-04-04 07:03:19 +000058colorsys.py --- Conversion between RGB and other color systems
Guido van Rossum612316f1997-03-14 04:12:52 +000059
Fred Drake71c1e501998-04-04 07:03:19 +000060dbhash.py --- (g)dbm-like wrapper for bsdhash.hashopen
Guido van Rossum15085381997-04-03 23:49:28 +000061
Fred Drake71c1e501998-04-04 07:03:19 +000062mhlib.py --- MH interface
Guido van Rossum612316f1997-03-14 04:12:52 +000063
Fred Drake71c1e501998-04-04 07:03:19 +000064pty.py --- Pseudo terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000065
Fred Drake71c1e501998-04-04 07:03:19 +000066tty.py --- Terminal utilities
Guido van Rossum612316f1997-03-14 04:12:52 +000067
Fred Drake71c1e501998-04-04 07:03:19 +000068cmd.py --- build line-oriented command interpreters (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000069
Fred Drake71c1e501998-04-04 07:03:19 +000070bdb.py --- A generic Python debugger base class (used by pdb)
Guido van Rossum612316f1997-03-14 04:12:52 +000071
Fred Drake71c1e501998-04-04 07:03:19 +000072ihooks.py --- Import hook support (for rexec)
73
74bisect.py --- Bisection algorithms (this is actually useful at times,
75especially as reference material)
Guido van Rossum612316f1997-03-14 04:12:52 +000076
Guido van Rossum90858221997-08-15 02:52:46 +000077
Guido van Rossum612316f1997-03-14 04:12:52 +000078\section{Parsing Python}
79
80(One could argue that these should all be documented together with the
Fred Drakec2112541997-10-06 21:41:30 +000081parser module.)
Guido van Rossumcfaf1431997-07-16 15:48:20 +000082
Fred Drake71c1e501998-04-04 07:03:19 +000083tokenize.py --- regular expression that recognizes Python tokens; also
Guido van Rossum90858221997-08-15 02:52:46 +000084contains helper code for colorizing Python source code.
Guido van Rossum612316f1997-03-14 04:12:52 +000085
Fred Drake71c1e501998-04-04 07:03:19 +000086pyclbr.py --- Parse a Python file and retrieve classes and methods
Guido van Rossum612316f1997-03-14 04:12:52 +000087
88
89\section{Platform specific modules}
90
Fred Drake71c1e501998-04-04 07:03:19 +000091ntpath.py --- equivalent of posixpath on 32-bit Windows
Guido van Rossum612316f1997-03-14 04:12:52 +000092
Fred Drake71c1e501998-04-04 07:03:19 +000093dospath.py --- equivalent of posixpath on MS-DOS
Guido van Rossum612316f1997-03-14 04:12:52 +000094
Guido van Rossum612316f1997-03-14 04:12:52 +000095
96\section{Code objects and files, debugger etc.}
97
Fred Drake71c1e501998-04-04 07:03:19 +000098compileall.py --- force "compilation" of all .py files in a directory
Guido van Rossum612316f1997-03-14 04:12:52 +000099
Fred Drake71c1e501998-04-04 07:03:19 +0000100py_compile.py --- "compile" a .py file to a .pyc file
Guido van Rossum612316f1997-03-14 04:12:52 +0000101
Fred Drake71c1e501998-04-04 07:03:19 +0000102repr.py --- Redo the `...` (representation) but with limits on most
Guido van Rossum612316f1997-03-14 04:12:52 +0000103sizes (used by pdb)
104
Guido van Rossum612316f1997-03-14 04:12:52 +0000105
106\section{Multimedia}
107
Fred Drake71c1e501998-04-04 07:03:19 +0000108audiodev.py --- Plays audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000109
Fred Drake71c1e501998-04-04 07:03:19 +0000110sunau.py --- parse Sun and NeXT audio files
Guido van Rossum612316f1997-03-14 04:12:52 +0000111
Fred Drake71c1e501998-04-04 07:03:19 +0000112sunaudio.py --- interpret sun audio headers
Guido van Rossum612316f1997-03-14 04:12:52 +0000113
Fred Drake71c1e501998-04-04 07:03:19 +0000114toaiff.py --- Convert "arbitrary" sound files to AIFF files
Guido van Rossum612316f1997-03-14 04:12:52 +0000115
Fred Drake71c1e501998-04-04 07:03:19 +0000116sndhdr.py --- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000117
Fred Drake71c1e501998-04-04 07:03:19 +0000118wave.py --- parse WAVE files
Guido van Rossum612316f1997-03-14 04:12:52 +0000119
Fred Drake71c1e501998-04-04 07:03:19 +0000120whatsound.py --- recognizing sound files
Guido van Rossum612316f1997-03-14 04:12:52 +0000121
122
123\section{Oddities}
124
125These modules are probably also obsolete, or just not very useful.
126
Fred Drake71c1e501998-04-04 07:03:19 +0000127dump.py --- Print python code that reconstructs a variable
Guido van Rossum612316f1997-03-14 04:12:52 +0000128
Fred Drake71c1e501998-04-04 07:03:19 +0000129find.py --- find files matching pattern in directory tree
Guido van Rossum612316f1997-03-14 04:12:52 +0000130
Fred Drake71c1e501998-04-04 07:03:19 +0000131fpformat.py --- General floating point formatting functions ---
132interesting demonstration of how to do this without using the \C{}
133library
Guido van Rossum612316f1997-03-14 04:12:52 +0000134
Fred Drake71c1e501998-04-04 07:03:19 +0000135grep.py --- grep
Guido van Rossum612316f1997-03-14 04:12:52 +0000136
Fred Drake71c1e501998-04-04 07:03:19 +0000137mutex.py --- Mutual exclusion --- for use with module sched
Guido van Rossum612316f1997-03-14 04:12:52 +0000138
Fred Drake71c1e501998-04-04 07:03:19 +0000139packmail.py --- create a self-unpacking \UNIX{} shell archive
Guido van Rossum612316f1997-03-14 04:12:52 +0000140
Fred Drake71c1e501998-04-04 07:03:19 +0000141poly.py --- Polynomials
Guido van Rossum612316f1997-03-14 04:12:52 +0000142
Fred Drake71c1e501998-04-04 07:03:19 +0000143sched.py --- event scheduler class
Guido van Rossum612316f1997-03-14 04:12:52 +0000144
Fred Drake71c1e501998-04-04 07:03:19 +0000145shutil.py --- utility functions usable in a shell-like program
Guido van Rossum612316f1997-03-14 04:12:52 +0000146
Fred Drake71c1e501998-04-04 07:03:19 +0000147util.py --- useful functions that don't fit elsewhere
Guido van Rossum612316f1997-03-14 04:12:52 +0000148
Fred Drake71c1e501998-04-04 07:03:19 +0000149zmod.py --- Compute properties of mathematical "fields"
Guido van Rossum612316f1997-03-14 04:12:52 +0000150
Fred Drake71c1e501998-04-04 07:03:19 +0000151tzparse.py --- Parse a timezone specification (unfinished)
Guido van Rossum612316f1997-03-14 04:12:52 +0000152
153
154\section{Obsolete}
155
Fred Drake71c1e501998-04-04 07:03:19 +0000156These modules are not on the standard module search path;
157\indexiii{module}{search}{path}
158but are available in the directory \file{lib-old/} installed under
159\file{\textrm{\$prefix}/lib/python\version/}. To use any of these
160modules, add that directory to \code{sys.path}, possibly using
161\envvar{PYTHONPATH}.
Guido van Rossumcfaf1431997-07-16 15:48:20 +0000162
Fred Drake71c1e501998-04-04 07:03:19 +0000163newdir.py --- New dir() function (the standard dir() is now just as good)
Guido van Rossum612316f1997-03-14 04:12:52 +0000164
Fred Drake71c1e501998-04-04 07:03:19 +0000165addpack.py --- standard support for "packages"
Guido van Rossum612316f1997-03-14 04:12:52 +0000166
Fred Drake71c1e501998-04-04 07:03:19 +0000167fmt.py --- text formatting abstractions (too slow)
Guido van Rossum612316f1997-03-14 04:12:52 +0000168
Fred Drake71c1e501998-04-04 07:03:19 +0000169Para.py --- helper for fmt.py
170
171lockfile.py --- wrapper around FCNTL file locking (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000172fcntl.lockf/flock intead)
173
Fred Drake71c1e501998-04-04 07:03:19 +0000174tb.py --- Print tracebacks, with a dump of local variables (use
Guido van Rossum612316f1997-03-14 04:12:52 +0000175pdb.pm() or traceback.py instead)
176
Fred Drake71c1e501998-04-04 07:03:19 +0000177codehack.py --- extract function name or line number from a function
Guido van Rossum61c27031997-07-18 21:08:07 +0000178code object (these are now accessible as attributes: co.co_name,
179func.func_name, co.co_firstlineno)
180
Guido van Rossum612316f1997-03-14 04:12:52 +0000181
182\section{Extension modules}
183
Fred Drake71c1e501998-04-04 07:03:19 +0000184bsddbmodule.c --- Interface to the Berkeley DB interface (yet another
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000185dbm clone).
186
Fred Drake71c1e501998-04-04 07:03:19 +0000187cursesmodule.c --- Curses interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000188
Fred Drake71c1e501998-04-04 07:03:19 +0000189dlmodule.c --- A highly experimental and dangerous device for calling
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000190arbitrary C functions in arbitrary shared libraries.
191
Fred Drake71c1e501998-04-04 07:03:19 +0000192newmodule.c --- Tommy Burnette's `new' module (creates new empty
193objects of certain kinds) --- dangerous.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000194
Fred Drake71c1e501998-04-04 07:03:19 +0000195nismodule.c --- NIS (a.k.a. Sun's Yellow Pages) interface.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000196
Fred Drake71c1e501998-04-04 07:03:19 +0000197timingmodule.c --- Measure time intervals to high resolution (obsolete
198--- use time.clock() instead).
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000199
Fred Drake71c1e501998-04-04 07:03:19 +0000200stdwinmodule.c --- Interface to STDWIN (an old, unsupported
Guido van Rossumb9ee9c21997-06-02 17:34:02 +0000201platform-independent GUI package). Obsolete; use Tkinter for a
202platform-independent GUI instead.
203
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000204The following are SGI specific:
205
Fred Drake71c1e501998-04-04 07:03:19 +0000206clmodule.c --- Interface to the SGI compression library.
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000207
Fred Drake71c1e501998-04-04 07:03:19 +0000208svmodule.c --- Interface to the ``simple video'' board on SGI Indigo
Guido van Rossum8d2893b1997-03-27 20:57:52 +0000209(obsolete hardware).
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000210
211The following is Windows specific:
212
Fred Drake71c1e501998-04-04 07:03:19 +0000213msvcrtmodule.c (in directory PC) --- define a number of Windows
Guido van Rossum9bdc4361998-03-03 02:00:14 +0000214specific goodies like \code{khbit()}, \code{getch()} and
215\code{setmode()}. (Windows 95 and NT only.)