Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26521 > unrolled thread

Re: dbf.py API question

Started byOle Martin Bjørndalen <ombdalen@gmail.com>
First post2012-08-05 05:04 +0200
Last post2012-08-05 05:04 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: dbf.py API question Ole Martin Bjørndalen <ombdalen@gmail.com> - 2012-08-05 05:04 +0200

#26521 — Re: dbf.py API question

FromOle Martin Bjørndalen <ombdalen@gmail.com>
Date2012-08-05 05:04 +0200
SubjectRe: dbf.py API question
Message-ID<mailman.2953.1344135879.4697.python-list@python.org>
On Thu, Aug 2, 2012 at 5:55 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
> SQLite has a neat feature where if you give it a the file-name of ':memory:'
> the resulting table is in memory and not on disk.  I thought it was a cool
> feature, but expanded it slightly: any name surrounded by colons results in
> an in-memory table.
>
> I'm looking at the same type of situation with indices, but now I'm
> wondering if the :name: method is not pythonic and I should use a flag
> (in_memory=True) when memory storage instead of disk storage is desired.
>
> Thoughts?

I agree that the flag would be more pythonic in dbf.py.

I was not aware that you are adding sqlite functionality to your
library. This is very cool!

I have been through the same questions with my own DBF library, and
I've come to some conclusions: First, I decided to make the library
read-only and in-memory. That is all we need in-house anyway. Second,
I decided to make an external tool for converting DBF files to sqlite:

  https://github.com/olemb/dbfget/blob/master/extras/dbf2sqlite

(To anyone reading: I have not yet made a public announcement of
dbfget, but I will shortly. Consider this an informal announcement:
https://github.com/olemb/dbfget/ )

I am considering adding a "streaming=True" flag which would make the
table class a record generator, and a "save()" method which would
allow you to save data back to the file, or to a new file if you
provide an optional file name. In fact, I had this functionality in
earlier versions, but decided to chuck it out in order to make the API
as clean as possible.

I hope this can help you somehow in your decision making process.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web