ANNOUNCE : dataenc.py and Pythonutils

Fuzzyman michael at foord.net
Tue Apr 6 03:48:40 EDT 2004


http://www.voidspace.org.uk/atlantibots/pythonutils.html

Various Python Resources

Home of :

Nanagram - anagram finder. Tkinter GUI version and a CGI for including
in your own websites.
Voidspace Python Guestbook

Modules :
*NEW* dataenc.py   - a definable binary to ascii encoding with
timestamping and binary interleaving.
ConfigObj 2     - a simple config file parser that behaves like a
dictionary.
listparser      - parsing strings into lists, elements of lists can
themselves be lists
dateutils       - functions for handling dates, leap years, future
dates etc
csv_s           - simple and straightforward CSV file reading and
writing


Dataenc :
Version 1.1.0

This is a set of functions that provide a binary to ASCII encoding
(based on a user definable TABLE) and binary interleaving which can be
used for combining files or time/datestamping data.

The purpose of this is that an encrypted password can be timestamped
and then included as ASCII in a hidden form field - in the HTML output
of a CGI. This gives a convenient way of providing a 'user login' with
a CGI - but the password (or it's SHA hash) that is hidden in the HTML
is 'time stamped' so that even if is extracted from the HTML it can't
be used once it has expired. Conceivably, the binary interweave
functions could be used for combining, 'watermarking' or timestamping
any data. The binary to ascii function is no 'better' than the
binascii module - but the mapping is user definable. It can be used
for storing *any* binary data as ascii - e.g. an SHA hash in a
ConfigObj !


Dateutils :
Version 1.0.2 

This is a set of functions for dealing with dates - written for a
little tool called 'Victory Days'. They are particularly useful for
dealing with appointments - e.g. the second Tuesday in March etc...

The functions will tell you what day of the week a date is, work out
the 'Julian day number' of a date is, correctly add numbers of days
(weeks, months etc) to a date and tell you the number of days between
a date, format a datestring etc. Full correction for leap years and
much more.


ConfigObj :
Version 2.0.0 

ConfigObj is a lightweight and easy to use config file parser. It
allows you and your users to write simple text config files - and for
you to easily load, parse, change and save them. In practise, you hand
ConfigObj a filename and it parses the values from keywords in the
file. For adding, retreiving or changing values/keywords it then
behaves like a normal python dictionary. You can then write the edited
data back to file if you need to with a simple configobj.write()
command. You can give it a list of keywords to parse - or simply have
it find all the keywords in the file. Comments inline with keywords
are preserved.


Listparse :

Not only this, but each value can either be a single value *or* a list
of values. This now includes lists of lists !! In other words each
element of a list, can itself be a list. This is implemented using
listparser - a simple module with functions for reading lists from a
string and also turning lists back into strings. A useful way of
storing data in a readable format. This module is available seperately
if you want but included in the configobj2 zip.


csv_s :

Functions for reading, writing and comparing CSV files. Very simple to
use. Useful for places where you haven't got Python 2.3 installed or
don't need the complexity of the CSV module.


A few other 'simple' goodies that some may find useful............

*Also* :

YAPLP - Yet Another Python Links Page
http://www.voidspace.org.uk/coollinks/python_links.shtml


Regards,


Fuzzy



More information about the Python-list mailing list