473,230 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

Python, xml, databases, ...


Hi!

I am planning a program and I need some advice about what tool to use.

Basically my program will deal with a object A. A is a list like
object with same attributtes and a list of objects B. B is also a list
like object with attributes and a list of object C.

class A:
Name = ""
...
List = [] # List of B

class B:
Name = ""
...
List = [] # List of C

....

I want to store the information in a A object in a file. The structure
is a tree-like structure and I think XML is a good choice. I want to
know what model SAX or DOM, will be better to write/read the
information from the file. Is posible the files to get big (>1MB) and
the XML HOWTO recommend to use SAX, is that ok? what would be eaiser?

In a future i want to be able to do search and in different instances
of object A. I think i can storoe the information in a database
format. What tool are suitable for this task? I have read somethin
about MySQL and PostgreSQL, but i think they are only for servers, no
for program, is that all right?

I would build a GUI for the program (presumibly with wxPython). I want
to separate the GUI layer from the program layer. For comunication of
this two layer I have think in asyncore, but i have read something
about twisted and piro. Can anyone give my his/her opinion about this?

Thanks in advance

Zunbeltz
--
Remove XXX from email: zu******@wm.lc.ehu.esXXX
Jul 18 '05 #1
5 1732
Zunbeltz Izaola wrote:
I want to store the information in a A object in a file. The structure
is a tree-like structure and I think XML is a good choice. I want to
know what model SAX or DOM, will be better to write/read the
information from the file. Is posible the files to get big (>1MB) and
the XML HOWTO recommend to use SAX, is that ok? what would be eaiser?

In a future i want to be able to do search and in different instances
of object A. I think i can storoe the information in a database
format.
I think you want to be clear whether you want a database or not. If you
want to put the data into a database, you probably do not want to also put
it into a file structure. Although you certainly could then store to file
in the database, I think you would end up loosing the usefulness of one or
the other (or both).
What tool are suitable for this task? I have read somethin
about MySQL and PostgreSQL, but i think they are only for servers, no
for program, is that all right?
What do you mean by 'they are only for servers'?

Any machine can run a service (such as MySQL or PostgreSQL), and if it
offers that service to other machines then it is acting as 'server', or it
can just use it locally.

What platform are you planning to run this on? If it is Linux, then either
MySQL or PostgreSQL are easy options - most distros have pre-compiled
versions out of the box.

On Windows, both MySQL and PostgreSQL rely on the Cygwin dll. It looks like
MySQL has an easier Windows install, but their use of the cygwin dll
outside of Cygwin proper has serious stability consequences if the user
installs another cygwin based program. PostgreSQL is a 'proper' cygwin
program, but will be harder for non-unix/linux people to
install/administer.

You could also consider Firebird (http://firebird.sourceforge.net/) it has a
native Windows version as well as a Unix/Linux version) or SQLite
(http://www.hwaci.com/sw/sqlite/) with PySQLite
(http://pysqlite.sourceforge.net/manual.html).

There is also GadflyB5 (http://gadfly.sourceforge.net/) which looks like it
is written in pure python. There are probably other options too.
I would build a GUI for the program (presumibly with wxPython). I want
to separate the GUI layer from the program layer. For comunication of
this two layer I have think in asyncore, but i have read something
about twisted and piro. Can anyone give my his/her opinion about this?


Funny, I asked almost the same question about 20 minutes before you did.

Cheers,

Rasjid.

Jul 18 '05 #2
> I think you want to be clear whether you want a database or not. If you
want to put the data into a database, you probably do not want to also put
it into a file structure. Although you certainly could then store to file
in the database, I think you would end up loosing the usefulness of one or
the other (or both).

I think i prefer first to store the information in a file. And then
see while the program is growing if it worth to use a database.
What tool are suitable for this task? I have read somethin
about MySQL and PostgreSQL, but i think they are only for servers, no
for program, is that all right?


What do you mean by 'they are only for servers'?

Any machine can run a service (such as MySQL or PostgreSQL), and if it
offers that service to other machines then it is acting as 'server', or it
can just use it locally.


Up, I concept missundertand of mine. I want to know if
MySQL/PostgreSQL are only used in large web servers and such things,
or are also used in small programs that both the server and client
runs localy.

What platform are you planning to run this on? If it is Linux, then either
MySQL or PostgreSQL are easy options - most distros have pre-compiled
versions out of the box.

I want to have the program in both linux and windows.
On Windows, both MySQL and PostgreSQL rely on the Cygwin dll. It looks like
MySQL has an easier Windows install, but their use of the cygwin dll
outside of Cygwin proper has serious stability consequences if the user
installs another cygwin based program. PostgreSQL is a 'proper' cygwin
program, but will be harder for non-unix/linux people to
install/administer.

You could also consider Firebird (http://firebird.sourceforge.net/) it has a
native Windows version as well as a Unix/Linux version) or SQLite
(http://www.hwaci.com/sw/sqlite/) with PySQLite
(http://pysqlite.sourceforge.net/manual.html).

There is also GadflyB5 (http://gadfly.sourceforge.net/) which looks like it
is written in pure python. There are probably other options too.

Can you give me an advaice about what has a better easy to
use/performance ratio.
I would build a GUI for the program (presumibly with wxPython). I want
to separate the GUI layer from the program layer. For comunication of
this two layer I have think in asyncore, but i have read something
about twisted and piro. Can anyone give my his/her opinion about this?


Funny, I asked almost the same question about 20 minutes before you did.


I have no see the question yet :-)
Cheers,

zunbeltz

Cheers,

Rasjid.


--
Remove XXX from email: zu******@wm.lc.ehu.esXXX
Jul 18 '05 #3
Zunbeltz Izaola wrote:
Up, I concept missundertand of mine. I want to know if
MySQL/PostgreSQL are only used in large web servers and such things,
or are also used in small programs that both the server and client
runs localy.


I've definitely seen MySQL used where both server and client run locally,
and I'm sure there is plenty of the same with PostgreSQL.
What platform are you planning to run this on? If it is Linux, then
either MySQL or PostgreSQL are easy options - most distros have
pre-compiled versions out of the box.


I want to have the program in both linux and windows.
On Windows, both MySQL and PostgreSQL rely on the Cygwin dll. It looks
like MySQL has an easier Windows install, but their use of the cygwin dll
outside of Cygwin proper has serious stability consequences if the user
installs another cygwin based program. PostgreSQL is a 'proper' cygwin
program, but will be harder for non-unix/linux people to
install/administer.

You could also consider Firebird (http://firebird.sourceforge.net/) it
has a native Windows version as well as a Unix/Linux version) or SQLite
(http://www.hwaci.com/sw/sqlite/) with PySQLite
(http://pysqlite.sourceforge.net/manual.html).

There is also GadflyB5 (http://gadfly.sourceforge.net/) which looks like
it
is written in pure python. There are probably other options too.


Can you give me an advaice about what has a better easy to
use/performance ratio.


Unfortunately, no, since I'm at about the same stage you are (ie, trying to
work out what to use).

I have _personally_ rulled out MySQL on Windows (due to it packaging the
cygwin dll in a non-standard way, since I use Cygwin at work), and will
only consider PostgreSQL on Windows if I can make the install trivial for a
non-technical user.

SQLite does not support Foreign Key constraints, so I think it is out for
me. Gadfly is not multi-user, so it is also out for me also.

Firebird is the only full featured open-source database that I know of that
has native binaries (non-cygwin) for Windows, and also runs on Linux and
Mac (although a native Windows port of PostgreSQL is in progress).

Another option that I have is to on Windows use the MDAC component and use a
MS Access backend database, and use MySQL or PostgreSQL on Linux/Mac.
See http://www.markcarter.me.uk/computing/python/ado.html for some info on
how to access a MS Access database from Python on Windows.

Without knowing what SQL feature set _you_ are after, it is impossible to
know what is the best option for you.
> I would build a GUI for the program (presumibly with wxPython). I want
> to separate the GUI layer from the program layer. For comunication of
> this two layer I have think in asyncore, but i have read something
> about twisted and piro. Can anyone give my his/her opinion about this?


Funny, I asked almost the same question about 20 minutes before you did.


I have no see the question yet :-)


My question was entitled 'Building a GUI agnostic database application'.

Cheers,

Rasjid.

Jul 18 '05 #4
Rasjid Wilcox <ra*****@openminddev.net> writes:

On Windows, both MySQL and PostgreSQL rely on the Cygwin dll. It looks
like MySQL has an easier Windows install, but their use of the cygwin dll
outside of Cygwin proper has serious stability consequences if the user
installs another cygwin based program. PostgreSQL is a 'proper' cygwin
program, but will be harder for non-unix/linux people to
install/administer.

You could also consider Firebird (http://firebird.sourceforge.net/) it
has a native Windows version as well as a Unix/Linux version) or SQLite
(http://www.hwaci.com/sw/sqlite/) with PySQLite
(http://pysqlite.sourceforge.net/manual.html).

There is also GadflyB5 (http://gadfly.sourceforge.net/) which looks like
it
is written in pure python. There are probably other options too.

Can you give me an advaice about what has a better easy to
use/performance ratio.


Unfortunately, no, since I'm at about the same stage you are (ie, trying to
work out what to use).

I have _personally_ rulled out MySQL on Windows (due to it packaging the
cygwin dll in a non-standard way, since I use Cygwin at work), and will
only consider PostgreSQL on Windows if I can make the install trivial for a
non-technical user.

SQLite does not support Foreign Key constraints, so I think it is out for
me. Gadfly is not multi-user, so it is also out for me also.

Firebird is the only full featured open-source database that I know of that
has native binaries (non-cygwin) for Windows, and also runs on Linux and
Mac (although a native Windows port of PostgreSQL is in progress).

Another option that I have is to on Windows use the MDAC component and use a
MS Access backend database, and use MySQL or PostgreSQL on Linux/Mac.
See http://www.markcarter.me.uk/computing/python/ado.html for some info on
how to access a MS Access database from Python on Windows.

Without knowing what SQL feature set _you_ are after, it is impossible to
know what is the best option for you.


Thanks for your advaice and i will think more carefully what i nedd
and read information about the dbs you mention.

I have no see the question yet :-)


My question was entitled 'Building a GUI agnostic database application'.


I am reading it know.

thanks

Zunbeltz
Cheers,

Rasjid.


--
Remove XXX from email: zu******@wm.lc.ehu.esXXX
Jul 18 '05 #5
Zunbeltz Izaola wrote:
Hi!
<snip>
I want to store the information in a A object in a file. The structure
is a tree-like structure and I think XML is a good choice. I want to
know what model SAX or DOM, will be better to write/read the
information from the file. Is posible the files to get big (>1MB) and
the XML HOWTO recommend to use SAX, is that ok? what would be eaiser?

Zunbeltz


In addition to the other suggestions made, you may want to consider the
embeddable Berkeley XML database, which may fit your needs better (or
not ;>):
http://www.sleepycat.com/download/index.shtml

If you are using Windows, you can get precompiled Python (and Java)
bindings here:
http://www.klamann-software.de/Community/index.html

Peace,
Joe

Jul 18 '05 #6

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

Similar topics

28
by: Erik Johnson | last post by:
This is somewhat a NEWBIE question... My company maintains a small RDBS driven website. We currently generate HTML using PHP. I've hacked a bit in Python, and generally think it is a rather...
37
by: Ubaidullah Nubar | last post by:
Hi, How well is Python suited for developing database based applications? I am new to Python so please bear with me if some of the questions are too simple. I specifically have the following...
1
by: Jeremy C. Reed | last post by:
Configuring gramps (genealogy software) says: checking Python bindings for gtk... ok checking Python bindings for GNOME... ok checking Python bindings for gconf... Traceback (most recent call...
13
by: Zeljko Vrba | last post by:
Now, why would I like to learn Python: because of IronPython port to CLR. Perl port to CLR doesn't seem to be coming soon. First Perl6 for Parrot has to be written, and then other backends.. ...
4
by: Carl | last post by:
Using COM and ADO on Win32, it is very easy to access databases (eg MySql, MS SQL Server, etc) from Python. Does anybody know if it is possible to access databases from Zope (which is written in...
25
by: Tor Erik Sønvisen | last post by:
Hi I need to browse the socket-module source-code. I believe it's contained in the file socketmodule.c, but I can't locate this file... Where should I look? regards tores
6
by: Petr Jakes | last post by:
I would like to know if anybody can point me to the site, where it is possible to find the tutorial "Using Databases in Python" which is mentioned by Steve Holden here: http://tinyurl.com/ectj8 ...
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
16
by: bobrik | last post by:
Hello, I am using the Python DB API for access to MySQL. But it is not platform-independent - I need a module not included in Python by default - python-mysql, and it uses a compiled binary...
3
by: Anthony Irwin | last post by:
Hi All, I am interested in playing with python some more and am looking at writing an app with data stored in a database. I have experience with mysql but thought that their may be other better...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.