newbie question: data structure for book indexing

wes weston wweston at att.net
Tue Mar 23 23:07:03 EST 2004


Peter Nelson wrote:
> I'm an editor without much programming experience.
> 
> What I want to do is write an application in Python to facilitate manual 
> indexing of books -- i.e. cardfile-type indexing by professional 
> indexers, not machine indexing.
> 
> Indexing apps I've worked with in the past basically replicate the 
> indexer's 3x5 index card file -- you add one entry at a time, then 
> "compile" the index when you're done.
> 
> What would be the best way to store and access this data? I'm thinking 
> that using a bsddb recno database might be simplest. But because the 
> index itself is ultimately a (very) sorted structure, would it make 
> sense to try storing the data in BTree format?
> 
> Would it make sense to design a Python class IndexEntry to mimic the 
> functionality of index cards, then store this in a db via shelve?
> 
> Any suggestions on where to get more info would be appreciated.
> Thanks,
> PN
> 

Peter,
    If you use a database and index the columns you will be
searching on, I would think your performance will be acceptable.
    How to do your project depends on things like how many books,
how many searches, on what different platforms you want to run
on.
    If "everything is small", you could use a shelve. This would
be portable to any python capable platform and require no setup.
    If you hope to create the be all end all of book card filing
systems(and why not), you want a relational DB. You could allow
the user to enter the strings needed to access the DB. You might
even code the sql commands to create tables - making it as easy
as possible to get the system up for a new site.
    I'm not familiar with the DB you mention. I have used MYSQL
on DOS and linux with the same db and code.
    'hope this helps.
wes




More information about the Python-list mailing list