#extends phd_pp_ru #implements respond #attr $Title = "Oleg Broytman's Python Software" #attr $Description = "Broytman Python Software" #attr $Copyright = 1994 ## #def body_html

Python Software

"The joy of coding Python should be in seeing short, concise, readable classes that express a lot of action in a small amount of clear code -- not in reams of trivial code that bores the reader to death." -- GvR

I am publishing here Python-related software; mostly written by me. Unless otherwise noted, all software is free for any use. Please, provide a reference to my name; don't blame me for anything. Copyrighted by Oleg Broytman and PhiloSoft Design.

Some pieces of software are not so free - they are protected by GNU GPL.

All bits packed with GNU tar+ gz or bz2. Install GNU tar or at least g(un)zip to extract files.

There are the following Libraries here, awaiting you to download: m_Lib, flad, pbar.
And programs: bookmarks_db, netscape-history, extract_mime, mimedecode, bdftogd.
Network-related libraries and programs ... not much yet: Python socket servers.
Some miscellaneous staff: PyGreSQL example, comparison of 3 Python-for-DOS interpreters.
Kjbuckets module is no longer here. Finally it has found a permanent maintainer and has been moved to gadfly.sf.net.
Legend:
Requires
The piece of software would not work without other; download it as well. "Requires: nothing" means "requires only standard Python library", of course.
Recommends
Does not strictly require, but good to have it anyway.
Suggests
Even easier than "recommends".

Libraries

m_Lib - Broytman's extensions for Python Library. (You can read why their names start with m :)
Download: m_lib.tgz
Requires: nothing
Recommends: nothing
Suggests: nothing
Inside the archive:
opstring.py
Some additional string handling/formatting functions.
opdate.py
Date/time manipulation functions. Not as object-oriented as mxDateTime, but still convenient, powerful and useful.
In this module Date is a number of days since 1/1/1600 (up to 31 Dec 3999). I am not sure about how easy it might be to extend the modules beyond these bounds. Time is just a number of seconds since midnight. User can add/subtract dates and times, calculate diffs ("how many days, months and years passed since 21 Dec 1967?") and so on. DateTime <==> UTC (GMT) conversion routines provided, too. This module required strptime.py for Russian month names.
www_util.py
Additional WWW-oriented functions that needs to be in standard module cgi but missing. Also base classes for all my HTML and XML parsers and filters.
m_shutil.py
Few utilities useful in shell-like scripts - in addition to standard module shutil.
flog.py
Logging to file with custom logging formats.
md5wrapper.py
Small but convenient wrapper for md5 builtin module.
mcrypt.py
Defines a function gen_salt() for builtin module crypt.
mkclock.py, tstclock.py
mkclock.py will test your system and generate a module clock.py, which provides the only function, clock(), similar to time.clock() but its values always started with 0. On some systems time.clock() returns current time, so you need to remember when the program began and extract the value from current time(). clock() does this for you automatically! tstclock.py just test the generated module.
tty_menu.py
Simple tty menu.

other_Lib - modules written by other people.
License: unknown
Download: other_lib.tgz
Requires: nothing
Recommends: nothing
Suggests: nothing
Inside the archive:
strptime.py
This is rather old module that come before time.strptime() appeared in standard Python library (1.5.2). I extended it a bit and added Russian names for days, months, etc (both koi8-r and windows-1251 encodings).
html.py
My version of Neale Pickett's html.py - object-oriented HTML generator.
subproc.py
My version of Ken Manheimer's subproc.py. It is now off the web, seems to be obsolete. There are other similar modules, look them up on Parnasus: O/S Support.
timeoutsocket.py
A copy of timeoutsocket.py.

mCorrect - Some patches I made for standard library. Now mostly obsolete. Detailed description available.
Download: mcorrect.tgz
Requires: nothing
Recommends: nothing
Suggests: nothing
Inside the archive:
tempfile.py, tempfile.diff
DOS-related patches.
os.py, os.diff
DJGPP-related patches.
dospopen.py
Low-level classes to help implement DOS version of popen(). Actual implementation is in os.py.

FLAD - Flat ASCII Database and configuration files modules. Detailed description available.
Download: flad.tgz
Requires: nothing
Recommends: nothing
Suggests: pbar (for progress bars in examples)
Inside the archive:
lib/flad.py
Root class. Simple Flat ASCII Database loading/storing.
lib/fladm.py
FLAD with "must-keys". You can define a set of keys that must be presented in every record. Moreover you can define "other keys" that do not required to be in every record.
lib/fladc.py
Using FLAD to store/use configuration files.
lib/fladw.py
Using FLAD to store/use WINI.INI-like configuration files.
test/test*.py
Test programs and examples.
test/test.txt, test/comment.txt, test/test.cfg
Test files.

pbar - TTY progress bar.
Download: pbar.tgz
Requires: nothing
Recommends: nothing
Suggests: nothing
Inside the archive:
lib/tty_pbar.py
Simple tty/console progress bar. Works on DOS/Windows/Unix consoles.
test/*.py
Test programs and examples.

Programs

Bookmarks database and Internet robot - a set of programs I use to manipulate my bookmarks. Detailed description available.
License: GPL
Download: sources and example shell scripts
Requires: m_Lib, other_Lib, flad
Recommends: pbar
Suggests: nothing
Inside the archive:
bkmk_objects.py
Low level objects (Bookmark, Folder, etc) and framework for managing bookmarks tree.
bkmk_parser.py
HTML parser, just it is.
Programs:
bkmk2db.py
The program to convert bookmarks.html to a database.
db2bkmk.py
The program to convert the database back to bookmarks.html.
check_urls.py
The program checks URLs in the DB by running a robot (plugin).
convert_st.py
The program converts the DB to a different format.
sort_db.py
The program sorts the DB by add_date, last_visit, last_modified or size.
check_dups.py
Prints a list of duplicate URLs in the database.
Plugins:
Storage
Directory with storage managers (DB plugins).
Writers
Directory with writers (data dumpers) plugins.
Robots
Directory with robots (URL checkers) plugins

Netscape history dump/load - a pair of programs I use to manipulate browser's history.
Download: netscape-history.tgz
Requires: Berkeley DB 1.85 and builtin module bsddb
Recommends: nothing
Suggests: nothing
Inside the archive:
dump
The program to dump history file to a text file. The program is based on Netscape history file lister by Hannu Krosing.
load
This is the opposite to dump - it loads the text file back to netscape history file.

Extract MIME - template programs that show how to write tools to extract MIME attachments from incoming mail messages. Detailed description available.
Download: extract_mime.tgz
Requires: nothing
Recommends: nothing
Suggests: nothing
Inside the archive:
extract_mime.py
The template program.
extract_mime
Shell wrapper to use extract_mime.py from /etc/aliases or such.

MIME decode - a program to decode MIME messages. Useful for multicharset mail lists archives and such. Detailed description available.
Download: mimedecode.tar.gz
Requires: nothing
Recommends: nothing
Suggests: nothing
Inside the archive:
mimedecode.py
The program.
mimedecode.docbook
Documentation source in DocBook format.
mimedecode.html, mimedecode.man, mimedecode.txt
Documentation in different formats.

bdftogd.py and mk_gdfonts - programs to convert BDF (XWindows) fonts to GD format.
Download: bdftogd.py and mk_gdfonts
Requires: m_Lib
Recommends: pbar
Suggests: nothing
Description:
bdftogd.py
Program to convert BDF (XWindows) fonts to GD format. Tested with gd 1.2.
mk_gdfonts
Shell script to generate all gd fonts in once.
My good fellow and colleague Vitus Wagner maintains a page with Cyrillic fonts, converted from fonts created by Sergey Vakulenko. Fonts tested with gd 1.2.

Miscellanea

rgb - an example of how to use PyGreSQL (PostgreSQL<=>Python interface)
License: GPL
Download: rgz.tgz
Requires: PyGreSQL, running PostgreSQL, running WWW server
Recommends: rgb.txt from X11
Suggests: nothing
Inside the archive:
rgb_connect.py
Module that hides connection details; later if you want move/rename your database or programs, or change user/password, you just need to edit one file.
init_rgb.py
Program that parses rgb.txt (from X11, not included here) and put table of colors into rgb database. The database must exists, so run "createdb rgb" before init_rgb.py.
check_255.py
Very simple program that checks whether color parts are (not) exceeds 255.
init_rgb_checked.py
The same as init_rgb.py, but it combined with check_255.py.
rgb.cgi
CGI script that draws colors from rgb database and generates HTML table full of colors. The program wants one parameter "cube=N", where N is integer 1..8 - these are just 8 subcubes of big color cube.

I wrote now old and outdated comparison of 3 Python-for-DOS interpreters.

#end def $phd_pp_ru.respond(self)