473,761 Members | 10,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Flat file, Python accessible database?

I've been Googling around for _small_, flat file (no server processes),
SQL-like database which can be easily access from Python. Speed and
perforamnce are of no issue, most important is that all data is contained
within single file and no server binary has to run in order to use the
dbase. Oh, and I'm using Python under Cygwin.

Ofcourse, ease of use and simplicity is most welcomed :). I'm currently
playing around SQLite+PySQLite and BerkeleyDB, but those two seem like an
overkill :(.

Thanks in advance...

--
_______ Karlo Lozovina - Mosor
| | |.-----.-----. web: http://www.mosor.net || ICQ#: 10667163
| || _ | _ | Parce mihi domine quia Dalmata sum.
|__|_|__||_____ |_____|
Nov 1 '05 #1
12 3753
Karlo Lozovina <_karlo_@_mosor .net_> writes:
I've been Googling around for _small_, flat file (no server
processes), SQL-like database which can be easily access from Python.


If you need it to be SQL-like, SQLite seems to be the right thing.

It's not clear to me what you mean by "flat" file here, but if you mean
it should be human readable, maybe the csv module is the thing.

http://docs.python.org/lib/module-csv.html

--
Björn Lindström <bk**@stp.lingf il.uu.se>
Student of computational linguistics, Uppsala University, Sweden
Nov 1 '05 #2
Karlo Lozovina wrote:
I've been Googling around for _small_, flat file (no server processes),
SQL-like database which can be easily access from Python. Speed and
perforamnce are of no issue, most important is that all data is contained
within single file and no server binary has to run in order to use the
dbase. Oh, and I'm using Python under Cygwin.


Depending on what you mean by "SQL-like" you might like KirbyBase
http://www.netpromi.com/kirbybase.html

Kent
Nov 1 '05 #3
On Nov 01, Karlo Lozovina wrote:
I've been Googling around for _small_, flat file (no server
processes), SQL-like database which can be easily access from
Python. Speed and perforamnce are of no issue, most important is
that all data is contained within single file and no server binary
has to run in order to use the dbase. Oh, and I'm using Python under
Cygwin.

Ofcourse, ease of use and simplicity is most welcomed :). I'm
currently playing around SQLite+PySQLite and BerkeleyDB, but those
two seem like an overkill :(.


Not sure about "SQL-like", but the conf/ini file type could be
considered a reasonable database format for simple needs, and is
easy to parse/write. The ConfigParser is documented here:

http://www.python.org/doc/current/li...figParser.html

And Fredrik Lundh's examples usage is here:

http://effbot.org/librarybook/configparser.htm

And the Initialization File format is described here:

http://en.wikipedia.org/wiki/INI_file

--
_ _ ___
|V|icah |- lliott http://micah.elliott.name md*@micah.ellio tt.name
" " """
Nov 1 '05 #4
bk**@stp.lingfi l.uu.se (=?utf-8?Q?Bj=C3=B6rn_ Lindstr=C3=B6m? =) wrote in
news:87******** ****@lucien.dre aming:
If you need it to be SQL-like, SQLite seems to be the right thing.
Tried that one, but had some problems setting things up. On the other
hand, BerkeleyDB + Pybsddb worked like a charm, with no setting up (under
Cygwin).

The problem is, Pybsddb is as badly documented as Windows Registry, no
examples, no tutorials, no nothing :(. Does anyone have some small
(possibly documented) Python program which does some basic database
routines - select, insert, and such?
It's not clear to me what you mean by "flat" file here, but if you mean
it should be human readable, maybe the csv module is the thing.
http://docs.python.org/lib/module-csv.html


Well, no, that's not it, but anyway thnx for the link, I need to parse a
lot of CSV files, so this will speed me up :).

--
_______ Karlo Lozovina - Mosor
| | |.-----.-----. web: http://www.mosor.net || ICQ#: 10667163
| || _ | _ | Parce mihi domine quia Dalmata sum.
|__|_|__||_____ |_____|
Nov 1 '05 #5
Karlo Lozovina wrote:
bk**@stp.lingfi l.uu.se (=?utf-8?Q?Bj=C3=B6rn_ Lindstr=C3=B6m? =) wrote in
news:87******** ****@lucien.dre aming:
If you need it to be SQL-like, SQLite seems to be the right thing.


Tried that one, but had some problems setting things up. On the other
hand, BerkeleyDB + Pybsddb worked like a charm, with no setting up (under
Cygwin).


I'm very curious what problems you had. In my experience SQLite
requires *nothing* I'd call "setup". You install Pysqlite or APSW,
write your code, and it runs and works. There are no configuration
steps required, nothing but creating tables (and that's a standard step
with any SQL-like database). What environment were you using, and what
kind of issues did you encounter? (I ask because I often recommend
SQLite, but would like to temper that advice if in some cases these
setup problems would cause someone trouble.)

-Peter
Nov 2 '05 #6
Karlo Lozovina wrote:
I've been Googling around for _small_, flat file (no server processes),
SQL-like database which can be easily access from Python.


Although it doesn't support SQL queries, Metakit
(http://www.equi4.com/metakit/python.html) is a very lightweight and
easy to use db with a nicely pythonic API.

-alex23

Nov 2 '05 #7
>>>>> "Peter" == Peter Hansen <pe***@engcorp. com> writes:
Karlo Lozovina wrote:
bk**@stp.lingfi l.uu.se (=?utf-8?Q?Bj=C3=B6rn_ Lindstr=C3=B6m? =) wrote
in news:87******** ****@lucien.dre aming:
If you need it to be SQL-like, SQLite seems to be the right thing. Tried that one, but had some problems setting things up. On the
other hand, BerkeleyDB + Pybsddb worked like a charm, with no
setting up (under Cygwin).

I'm very curious what problems you had. In my experience SQLite
requires *nothing* I'd call "setup". You install Pysqlite or APSW,
write your code, and it runs and works.


I imagine that's the "setup" OP is talking about. You need to install it
separately as opposed to bsddb. I wish SQLite is bundled with Python 2.5. To
the OP, you could try gadfly (http://gadfly.sourceforge.net/gadfly.html) or
KirbyBase (http://www.netpromi.com/kirbybase.html) but they are also
separate packages to install. I would personally stick with SQLite.

Ganesan

--
Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA
Web: http://employees.org/~rganesan | http://rganesan.blogspot.com

Nov 2 '05 #8
On Tue, 1 Nov 2005, Karlo Lozovina wrote:
bk**@stp.lingfi l.uu.se (=?utf-8?Q?Bj=C3=B6rn_ Lindstr=C3=B6m? =) wrote in
news:87******** ****@lucien.dre aming:
If you need it to be SQL-like, SQLite seems to be the right thing.
Tried that one, but had some problems setting things up.


That is strange. SQLite + PySQLite are IMHO no harder
to install than BerkeleyDB + Pybsddb...

On the other
hand, BerkeleyDB + Pybsddb worked like a charm, with no setting up (under
Cygwin).


Sincerely yours, Roman Suzi
--
rn*@onego.ru =\= My AI powered by GNU/Linux RedHat 7.3
Nov 2 '05 #9
Peter Hansen wrote:
Karlo Lozovina wrote:
bk**@stp.ling fil.uu.se (=?utf-8?Q?Bj=C3=B6rn_ Lindstr=C3=B6m? =) wrote in
news:87****** ******@lucien.d reaming:

If you need it to be SQL-like, SQLite seems to be the right thing.


Tried that one, but had some problems setting things up. On the other
hand, BerkeleyDB + Pybsddb worked like a charm, with no setting up (under
Cygwin).

I'm very curious what problems you had. In my experience SQLite
requires *nothing* I'd call "setup". You install Pysqlite or APSW,
write your code, and it runs and works. There are no configuration
steps required, nothing but creating tables (and that's a standard step
with any SQL-like database). What environment were you using, and what
kind of issues did you encounter? (I ask because I often recommend
SQLite, but would like to temper that advice if in some cases these
setup problems would cause someone trouble.)

-Peter


My experience on Cygwin was that I had to install sqlite before pySqlite
worked. Maybe that's what was meant.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 2 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
8805
by: mir nazim | last post by:
hi. i want to know if there is any flat-file relational database system available for python. i require it in a project. it should have following capabilities: 1. should be small and compact on system requirments. 2. should be roubust and fast. 3. must be able to handle a bit large tables( upto 5000 rows) 4. should be available for both linux and ms windows 9x/xp/2000 platforms.
3
2286
by: I.V. Aprameya Rao | last post by:
Hi I have to implement a flat file dbms. The basic condition is that relations will be given in files and i will have to run certain select project join queries on those relations. Can someone tell me as to which language will be faster, python or C++?? Aprameya
1
2189
by: Tim Fierro | last post by:
Hello, I have had many years using flat file databases (File Express from way back) but am now at a company where a relational database is needed and would carry us into the future. Since I know some basics on databases, have VB Pro programming experience over the years, and I know most of what we need to carry as far as data; I have decided to create a database for our needs instead of finding an off the shelf program that may not be...
14
2281
by: vunet.us | last post by:
Hi, I would like to use flat file data storage instead of database. Since I am new to it, I am wondering: What text file extension is a safe one to store my data online and how cost- and time-effective is this method (flat file data storage). Anyone can share thoughts? Thanks
9
2193
by: FFMG | last post by:
In my site I have a config table, (MySQL), with about 30 entries; the data is loaded on every single page load. This is not the only call to the db, (we do a total of about 8 calls to the db). As with many configurations settings, once the options are set the values will not change much. So I thought it would be a good idea to move the data to a flat file. I have written a small wrapper class to first look for the file, if it exists...
9
1892
by: =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post by:
Hello I am developing a system for user tracking. In this I am tracking all the visitors that came to my website. i developed this using a HTTPModule and storing the data in a SQL Server database. Everything worked fine till my website gets good traffic. When website is getting good traffic, this method is slowing down the entire application. So I am planning to use flat files instead of SQL Server database. My doubts are
15
5276
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.