Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'correspond': 0.07; 'desired.': 0.07; 'omit': 0.07; 'table.': 0.07; 'subject:question': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sql,': 0.09; 'sqlite': 0.09; 'surrounded': 0.09; 'resulting': 0.13; 'colons': 0.16; 'disk.': 0.16; 'in- memory': 0.16; 'message-id:@dough.gmane.org': 0.16; 'pythonic': 0.16; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'subject:API': 0.16; 'thoughts?': 0.16; 'wrote:': 0.17; 'expanded': 0.17; 'memory': 0.18; 'back.': 0.22; "i'd": 0.22; 'seems': 0.23; 'random': 0.24; 'feature': 0.24; 'header:User- Agent:1': 0.26; 'wondering': 0.26; 'disk': 0.27; 'header:X -Complaints-To:1': 0.28; 'feature,': 0.29; 'table,': 0.29; 'convert': 0.29; "i'm": 0.29; 'connection': 0.30; 'could': 0.32; 'to:addr:python-list': 0.33; 'operations': 0.33; 'skip:d 20': 0.34; 'table': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'method': 0.36; 'should': 0.36; 'rather': 0.37; 'subject:: ': 0.38; 'perform': 0.38; 'object': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'decision': 0.60; 'situation': 0.62; 'results': 0.65; 'flag.': 0.84; 'furman': 0.84; "it'd": 0.84; 'ethan': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: dbf.py API question Date: Fri, 03 Aug 2012 11:03:13 +0200 Organization: None References: <501AA304.3090000@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p508493ae.dip.t-dialin.net User-Agent: KNode/4.7.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343984571 news.xs4all.nl 6864 [2001:888:2000:d::a6]:50796 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26421 Ethan Furman 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. For SQLite it seems OK because you make the decision once per database. For dbase it'd be once per table, so I would prefer the flag. Random > Thoughts? - Do you really want your users to work with multiple dbf files? I think I'd rather convert to SQLite, perform the desired operations using sql, then convert back. - Are names required to manipulate the table? If not you could just omit them to make the table "in-memory". - How about a connection object that may either correspond to a directory or RAM: db = dbf.connect(":memory:") table = db.Table("foo", ...)