Re: File DB instead of real database?
On 13 Apr 2007 21:14:36 -0700, Jia Lu <[EMAIL PROTECTED]> wrote: > I donot want to use a real DB like MySQL ... But I need something to > save about more than 1000 articles. > Is there any good ways? SQLite is a good option, as you were told. But what about put them in a dictionary and then cPickle it to disk? (using 2 as optimization setting in cPickle command). -- http://mail.python.org/mailman/listinfo/python-list
Re: File DB instead of real database?
Jia Lu a e'crit : > Hello all > > I donot want to use a real DB like MySQL ... Whether MySQL is qualifies as a "real DB" is still an open question. But you can use SQLite, which is an embedded SQL database. -- http://mail.python.org/mailman/listinfo/python-list
Re: File DB instead of real database?
On 14 avr, 06:14, "Jia Lu" <[EMAIL PROTECTED]> wrote: > Hello all > > I donot want to use a real DB like MySQL ... But I need something to > save about more than 1000 articles. > Is there any good ways? > Hi, For small sets of data PyDbLite is a good alternative to full-blown db engines >>> import PyDbLite >>> db = PyDbLite.Base("records").create('title','artist') >>> db.insert('Ok Computer','Radiohead') 0 >>> db.insert('Night On Earth','Rialto') 1 >>> db.insert('Employment','Kaiser Chiefs') 2 >>> print [ r['title'] for r in db ] ['Ok Computer', 'Night On Earth', 'Employment'] >>> print [ r['artist'] for r in db if r['artist'].startswith('R') ] ['Radiohead', 'Rialto'] >>> The syntax is intuitive for Python programmers (list comprehensions) ; it's a single, small Python module downloable at http://quentel.pierre.free.fr/PyDbLite/index.html Regards, Pierre -- http://mail.python.org/mailman/listinfo/python-list
Re: File DB instead of real database?
On Apr 13, 9:14 pm, "Jia Lu" <[EMAIL PROTECTED]> wrote: > I do not want to use a real DB like MySQL ... > But I need something to save about more than > 1000 articles. Is there any good ways? The latest version of Dejavu includes a filesystem backend. See "Folders" at http://projects.amor.org/docs/dejavu/1.5.0RC1/storage.html#other Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Re: File DB instead of real database?
Jia Lu wrote: > I donot want to use a real DB like MySQL ... But I need something to > save about more than 1000 articles. > Is there any good ways? import anydbm Richard -- http://mail.python.org/mailman/listinfo/python-list
Re: File DB instead of real database?
Jia Lu wrote: > I donot want to use a real DB like MySQL ... But I need something to > save about more than 1000 articles. > Is there any good ways? (in Python 2.5): #-- begin import sqlite3.dbapi2 as sqlite con = sqlite.connect("path/to/new/filename.db") cur = con.cursor() cur.executescript(""" create table articles (id integer primary key autoincrement, name text, content clob); create index articles_name on articles (name); insert into articles (name, clob) values ("My new article", "Article text. blah blah"); """) con.commit() #-- end -- pkm ~ http://paulmcnett.com -- http://mail.python.org/mailman/listinfo/python-list
File DB instead of real database?
Hello all I donot want to use a real DB like MySQL ... But I need something to save about more than 1000 articles. Is there any good ways? Thanx Jia Lu -- http://mail.python.org/mailman/listinfo/python-list