473,788 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making dynamic data available via ODBC with Python


I have a Python application server that manages several different data
sets, permits various reports to be run on them and the data to be
downloaded as tab-delimetered files, all via a web interface.

I'd like to explore the possibilities of making the data directly
available in Windows applications (such as Excel, where it would very
nice to directly do pivot tables from the live data) via ODBC.

So I basically need for my Python server (deployed on UNIX) to act as
a remotely queriable database. This is live and changing data, so I'd
prefer not to have to dump it into a real database first, but I
suppose that's one solution (e.g. letting PostgreSQL get the query,
run some trigger that asks my server to update the table with data and
then return the data).

Knowing little about the various available ODBC modules, one solution
seems to be to take a client/server protocol of an existing database
(such as PostgreSQL) and implement a Python server for it: so my
Python program acts like a server you could run the psql client up
against and so also get data via ODBC using the PG ODBC drivers. It
seems a bit complex because all I want to allow is to select a table
with a certain name, allow a query of what columns are available and
what type they are and to fetch the data, perhaps with minimal support
for filtering queries.

I've seen at least one program that emulates the PG client/server API
-- I think it stored some configuration data, so it acted like a
ordinary PG server you could run queries against but wasn't really
one. Its name completely escapes me at the moment though.

Is there some better way of doing this -- some way to provide tabular
data remotely to Windows machines, usable in Office programs, which
happens to already have some Python code written for it? Looking
around, there is at least one XML-to-ODBC bridge but encoding the
entire data file as XML is likely to have prohibitive overhead.

--
=============== =============== =============== =============== ===
<er**********@a ndreasen.org> Herlev, Denmark
<URL:http://www.andreasen.o rg/> <*>
=============== =============== =============== =============== ===

Jul 18 '05 #1
1 1649
>
Is there some better way of doing this -- some way to provide tabular
data remotely to Windows machines, usable in Office programs, which
happens to already have some Python code written for it? Looking
around, there is at least one XML-to-ODBC bridge but encoding the
entire data file as XML is likely to have prohibitive overhead.


I still think that this is the most viable solution - if performance is bad,
you could still explore other possibilities.

If it actually is performing bad - either literally or due to a badly
design - I'd go for creating a odbc2your-server driver. That would allow
you to cope with a pretty well defined standard (odbc) and doing the
network stuff totally on your own behalf instead of trying to make some
self-written protocol stack like postgres so compatible that a postgres
odbc driver doesn't know the difference.

--
Regards,

Diez B. Roggisch
Jul 18 '05 #2

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

Similar topics

5
6191
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select from the cli is for all intents practicaly instantaneous. After much research I discovered that PHP by default uses a dynamic cursor type which can be quite a bit slower than a forward only cursor. BTW I have been searching forward only/read...
9
3314
by: Tony Lee | last post by:
Some time a ago, on this newsgroup the following comments were made in recommending good references for Access (2003) >I used to recommend Dr. Rick Dobson's, "Programming Access <version>" for >people moving from power user to developer, but now I suggest you browse >it, >too. It strongly emphasizes ADO, which knowledgeable Microsoft insiders no >longer recommend, and the Access ADP client to SQL Server. He writes well, >and is a good...
5
6103
by: Mike | last post by:
I am writing a .NET application in C# that uses Crystal Reports. I want the crystal reports to grab information from a database no matter where the database is located. To do this, I want to create an ODBC connection to the database at runtime in order for the report to grab data from the database. Does anyone have a code snippet that shows how to do this? Thank you very much for your reply. Mike
0
2894
by: Andy Lee | last post by:
System.Data.Odbc namespace is only available in .NET framework 1.1 while Microsoft.Data.Odbc is available in .NET framework 1.0. I heard that the System.Data.Odbc is exact the same as Microsoft.Data.Odbc except some bug fixes. But I am not sure. Could someone help me confirm that or correct me? I have some old code using Microsoft.Data.Odbc and I would like to replace it with the new System.Data.Odbc. Can I just do the string...
5
1891
by: dananrg | last post by:
I was messing around with the native ODBC module (I am using Python in a Win32 environment), e.g: import dbi, odbc ....and it seems to meet my needs. I'd rather use a module that comes natively with Python if it works (don't care about performance in this particular use case; just that it works). The only issue I've had so far is retrieving data from Oracle when an
2
4892
by: Carl K | last post by:
A friend needs to convert c-tree plus data to MySql. I can to the "to MySql part, but need some help with the "from c-tree." If I just wanted to get this done, I would hunt down the ODBC driver and use some MSy thing. But I am trying to hone my Python skills, but right now I am in over my head, thus this post. I think with a little boost I will be able to make it all come together. (well, little boost may be an understatement - I have...
3
6270
by: Harmony504 | last post by:
HELP! Setup: PHP5.2.5, IIS 5.1, XP, AS/400 (DB/400 or DB2) I am trying to connect to a DB2 database from my computer. I installed DB2 Connect and set up the ODBC Driver in the Data Source Administrator. I uncommented the extension=php_ibm_db2.dll line in my php.ini file. <?php $DBName = "WSC520"; // The name of the database ...
11
6259
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as the app is concerned). The problem is, If someone makes a typo, they may get an unexpected error due accidentally calling the original attribute instead of the wrapped version. Does anyone have a simple solution for this?
5
2586
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization algorithm to solve a certain messy problem, and many different things. For that I often use several general modules that I have written, like implementation of certain data structures, and small general "utility" functions/classes, plus of course...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
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...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
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
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
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
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.