Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'insert': 0.05; 'output': 0.05; 'table.': 0.07; 'rows': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'real-time.': 0.16; 'temp': 0.16; 'select': 0.22; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'feeds': 0.31; 'libraries': 0.31; 'another': 0.32; 'table': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'in.': 0.36; 'processed': 0.36; 'subject:one': 0.36; 'useful': 0.36; 'project': 0.37; 'thank': 0.38; 'delete': 0.39; 'you.': 0.62; 'sample': 0.67; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=RBVIk3OfBHz5cPyFv3NuGjGH94DPSQYY99PNQ5zAfAQ=; b=lvRdtKNXu38TdGEXtkMV3iIOY2RbxW9ek/Ksbn+/Nf6GgFARnvUJVW2SJ1iJXgEtJZ 0hIRDA5uYe+gVTlD9QPvWUMhbWJaMs55YIk0UHHNnIdjtgsycXWgzJjU6zFUAXpk8+5l F2L89zStI726VgaJ0U2Fam3bqyYtnVnWIbXydl6QhitJ+us16UTiPVbKvuvHahBVBi4S CXfeHNmKJwiWssoA1HfpN6/3j6w6P/bAChk7B4HS7MB1cEz/Udpz4x6ENusx/FGQF3CC O+lhk3hufVAzB4CgXVscyANo4GWaVVfXpiYu3TECtp+7pdT6VEK+gXuXQ+kdO7ZN3aV2 ymWA== MIME-Version: 1.0 X-Received: by 10.50.78.229 with SMTP id e5mr225560igx.49.1389925392147; Thu, 16 Jan 2014 18:23:12 -0800 (PST) In-Reply-To: References: Date: Thu, 16 Jan 2014 19:23:12 -0700 Subject: Re: Process datafeed in one MySql table and output to another MySql table From: Jason Friedman Cc: python-list Content-Type: multipart/alternative; boundary=089e013c64a2436cb604f02139b0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389925394 news.xs4all.nl 2950 [2001:888:2000:d::a6]:49802 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64133 --089e013c64a2436cb604f02139b0 Content-Type: text/plain; charset=UTF-8 > > I have a datafeed which is constantly sent to a MySql table. The table > grows constantly as the data feeds in. I would like to write a python > script which process the data in this table and output the processed data > to another table in another MySql database in real-time. > > Which are the python libraries which are suitable for this purpose? Are > there any useful sample code or project on the web that I can use as > reference? Thank you. > Is there a reason you do not want to move these rows with a mysql command? drop table if exists temp; insert into temp select * from source where ...; insert into target select * from temp; delete from source where id in (select id from temp); --089e013c64a2436cb604f02139b0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have a datafeed which is constantly sent to a = MySql table. The table grows constantly as the data feeds in. I would like = to write a python script which process the data in this table and output th= e processed data to another table in another MySql database in real-time.
Which are the python libraries which are suitable for this purpose? Are the= re any useful sample code or project on the web that I can use as reference= ? Thank you.

Is there a reason you do n= ot want to move these rows with a mysql command?
drop table if exists temp;
insert into temp select * from so= urce where ...;
insert into target select * from temp;
= delete from source where id in (select id from temp);

--089e013c64a2436cb604f02139b0--