Implementation of Book Organization tool (Python2.[x])

Steve Howell showell30 at yahoo.com
Sun Nov 22 23:27:34 EST 2009


On Nov 22, 6:06 pm, "~km" <knny.m... at gmail.com> wrote:
> Hi together,
>
> I'm a python-proficient newbie and want to tackle a program with
> Python 2.x, which basically organizes all my digital books (*.pdf,
> *.chm, etc..) and to give them specific "labels", such as:
>
> "Author" -> string
> "Read" -> boolean
> "Last Opened:" -> string
> and so on..
>
> Now my question is:
>
> Is it a better method to use a /database/, a /static File/, with some
> Markup (e.g.: YAML, XML), a Python dictionary or are there better ways
> I
> don't know of.., for organizing my books collection? I'm sure you can
> do
> it in any way above, but I'm apelling to /your/ personal experience
> and
> preference. Please give me at least one reason, why.

If your data structure is just a list of dictionaries and you do not
have any performance/security issues to consider yet, then you can use
pure Python for your input, since it is pretty easy to hand-edit, and
then occasionally you could use the PrettyPrinter module to format
your data.  YAML is another option, as it can offer a slightly cleaner
syntax, but I do not think it buys you a whole lot more than that for
your use case.  Same for JSON--I like JSON but you do not need it
right away.

PrettyPrinter is batteries included.

I would avoid XML and pickle.



More information about the Python-list mailing list