Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'third-party': 0.04; 'apis': 0.09; 'restful': 0.09; 'so?': 0.09; 'python': 0.11; 'project,': 0.12; 'project)': 0.16; 'pypi.': 0.16; 'pythonic': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'thu,': 0.19; 'thanks.': 0.20; 'feb': 0.22; 'cc:addr:gmail.com': 0.22; 'to:name:python-list@python.org': 0.22; '(or': 0.24; 'cc:2**0': 0.24; 'possibly': 0.26; 'query': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(new': 0.31; "i'd": 0.34; 'received:209.85': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'hi,': 0.36; 'two': 0.37; 'received:209': 0.37; 'to:addr:python-list': 0.38; '12,': 0.39; 'to:addr:python.org': 0.39; '2015': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=YdxSkOuXgtC8auUQEhaTLUi8rnJNEEEWgFFqK/ca2Vs=; b=uMQWMbg46eRUiq5kHCMskeDmj3dcqz+WkQwOaXlFjpe0cE0sfmF322GLo49CV8lJGf F4c8pTaDVVOXlhGhh2DR2xCx25tsP95a7DkTV+OvgPF5a/hNWNDSq1Y7+RmNyuKCmu85 7TDs7QKEfP7XPxnJ6+jVnvzVQJAxcgB81O1GS4JMymaRDqBO4zNPsNqCcnOgmDmLOIOv 4NkVsq9EbtCFCtwGC8W+Zz1PeaboRXEtLetJ7ZGeyVpm6G4tfYOyUalAxO51nzOr6Sbw NLGOIxWZ/mZ3GP+1V61/7DITm+ZXIs7sQ+GpCcE1j3QoaPBog6DuL9w2+EjBbd726M7w QD6Q== X-Received: by 10.42.188.133 with SMTP id da5mr9616346icb.37.1423764001500; Thu, 12 Feb 2015 10:00:01 -0800 (PST) MIME-Version: 1.0 Sender: zachary.ware@gmail.com In-Reply-To: <7a6ca7b9-ad3a-4361-88fc-580e41452874@googlegroups.com> References: <7a6ca7b9-ad3a-4361-88fc-580e41452874@googlegroups.com> From: Zachary Ware Date: Thu, 12 Feb 2015 11:59:41 -0600 X-Google-Sender-Auth: hrvjvdSFvLpb8XuJQ9tAbAtnW7U Subject: Re: Async/Concurrent HTTP Requests To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Cc: Ari King 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423764004 news.xs4all.nl 2970 [2001:888:2000:d::a6]:55798 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3691 X-Received-Body-CRC: 2317294868 Xref: csiph.com comp.lang.python:85600 On Thu, Feb 12, 2015 at 10:37 AM, Ari King wrote: > Hi, > > I'd like to query two (or more) RESTful APIs concurrently. What is the pythonic way of doing so? Is it better to use built in functions or are third-party packages? Thanks. Have a look at asyncio (new in Python 3.4, available for 3.3 as the 'tulip' project) and possibly the aiohttp project, available on PyPI. I'm using both for a current project, and they work very well. -- Zach