OData – ScraperWiki https://blog.scraperwiki.com Extract tables from PDFs and scrape the web Tue, 09 Aug 2016 06:10:13 +0000 en-US hourly 1 https://wordpress.org/?v=4.6 58264007 Connecting QlikView to ScraperWiki with OData https://blog.scraperwiki.com/2014/05/connecting-qlikview-to-scraperwiki-with-odata/ Mon, 19 May 2014 10:25:57 +0000 https://blog.scraperwiki.com/?p=758221697 This is a guest post by Nuno Faustino who shows how to connect QlikView to ScraperWiki using our new Odata connector.

The first step is to collect some data using the ScraperWiki Platform, the demonstration here uses the our new US Stock Market data tool but could equally well have used the Twitter Follower or Twitter Search tools.

To connect Qlikview to ScraperWiki you should install the OData tool on the dataset on the ScraperWiki Platform and paste the link provided in File > Edit Script > Web files (in the Data pane at the bottom). For each table you have in your dataset there will be a different link.

qlikview-img1

On the next dialog page just choose “feed” and then “Finish”.

You will end up with and apparently complicated piece of code in your browser, but with this you only need to eliminate all rows which do not contain content/properties and also those who end in m:type.

qlikview-img2

To get just the data you have scraped into your table, the end result should be like this:

LOAD [content/properties/Volume] as Volume,
[content/properties/AdjClose] as AdjClose,
[content/properties/High] as High,
[content/properties/Low] as Low,
[content/properties/rowid] as rowid,
[content/properties/Date] as Date,
[content/properties/Close] as Close,
[content/properties/Open] as Open
FROM [https://free-ec2.scraperwiki.com/tb89xnn/7ynpetp3oczdtbt/cgi-bin/odata/stockdata] (XmlSimple, Table is [feed/entry]);

After saving and reloading, you have all your data ready for action in Qlikview.

qlikview-img3

Happy Qliking…

]]>
758221697
Our new US stock market tool https://blog.scraperwiki.com/2014/05/our-new-us-stock-market-tool/ Wed, 14 May 2014 08:13:27 +0000 https://blog.scraperwiki.com/?p=758221600 In a recent blog post, Ian talked about getting stock market data into Tableau using our Code in a Browser tool. We thought this was so useful that we’ve wrapped this up into an easy-to-use tool. Now you can get stock data by pressing a button and choosing the stocks you’re interested in, no code required!

All you have to do is enter some comma-separated stocks, for example: AAPL,FB,MSFT,TWTR and then press the Get Stocks button to collect all the data that’s available. Once you’ve set the tool running, the data continues to automatically update with the latest data daily. Just as with any other ScraperWiki dataset, you can view in a table, query with SQL or download the data as a spreadsheet for use elsewhere. With our new OData connector, you can also import the data directly into Tableau.

You can see Ian demonstrating the use of the US stock market tool, and using the OData tool to connect to Tableau in this YouTube video:

]]>
758221600
Try out the Tableau and QlikView connector https://blog.scraperwiki.com/2014/05/try-out-the-tableau-and-qlikview-connector/ Fri, 02 May 2014 08:02:52 +0000 https://blog.scraperwiki.com/?p=758221564 In March, we launched an OData tool.

If you use Tableau or QlikView, it lets you easily get and refresh data from ScraperWiki.

Connect with OData

From today, the OData tool is now available on our new 30 day trial accounts.

Which means anyone can try it out for free!

Instructions here (particularly for Tableau).

]]>
758221564
Yahoo!Finance to Tableau via ScraperWiki https://blog.scraperwiki.com/2014/04/yahoofinance-to-tableau-via-scraperwiki/ Thu, 17 Apr 2014 10:24:51 +0000 https://blog.scraperwiki.com/?p=758221405 Our recently announced OData connector gives Tableau users access to a world of unstructured and semi-structured data.

In this post I’d like to demonstrate the power of a Python library, Pandas, and the Code in a Browser tool to get “live” stock market data from Yahoo!Finance into Tableau. Python is a well-established programming language with a rich ecosystem of software libraries which can provide access to a wide range of data.

This isn’t a route to doing high frequency trading but it is a demonstrates the principles of using ScraperWiki as an adaptor to data on the web. Although Tableau supports a wide range of data connections it can’t handle everything. As well as ready-made tools to collect data and serve it up in different formats, ScraperWiki allows users to write their own tools. The simplest method is to use the “Code in a browser” tool.

I wrote about the Pandas library a few weeks ago, its designed to provide some of the statistical and data processing functionality R to users of Python. It grew out of the work of a financial analyst, Wes McKinney, so naturally he added a little piece of functionality to pull in stock market data from Yahoo!Finance. The code required to do this is literally a single line.

To make data we collect using the pandas library available to all of ScraperWiki tools, like the OData connector or the View in a Table tool, we need to write the data into a local database.

You can see the code to get Yahoo!Finance data and make it available in the screenshot below, and you can get a copy directly from this GitHub gist.

code-in-browser-screenshot

Once you’ve entered the code, then you can run it immediately or schedule it to run regularly.

In less than 10 lines of code we’ve added a new data source to Tableau!

The most complicated part of the process is getting the pandas library to recognise the dates properly. This is by no means a polished tool but it is fully functioning and can easily be modified to collect different stock data. Obvious extensions would be to collect a list of stocks, and to provide a user interface.

Once we have the data then we can access it over OData, I followed Andrew Watson’s instructions for making a “candlestick” plot (here). And the resulting plot is shown below and can be found on Tableau Public.

image

On a desktop installation of Tableau you can refresh the data at the click of a button.

What data can you get in less than 10 lines of code?

]]>
758221405
Publish your data to Tableau with OData https://blog.scraperwiki.com/2014/03/publish-your-data-to-tableau-with-odata/ https://blog.scraperwiki.com/2014/03/publish-your-data-to-tableau-with-odata/#comments Fri, 07 Mar 2014 16:48:38 +0000 https://blog.scraperwiki.com/?p=758221163 We know that lots of you use data from our astonishingly simple Twitter tools in visualisation tools like Tableau. While you can download your data as a spreadsheet, getting it into Tableau is a fiddly business (especially where date formatting is concerned). And when the data updates, you’d have to do the whole thing over again.

There must be a simpler way!

And so there is. Today we’re excited to announce our new “Connect with OData” tool: the hassle-free way to get ScraperWiki data into analysis tools like Tableau, QlikView and Excel Power Query.

odata-screenshotTo get a dataset into Tableau, click the “More tools…” button and select the “Connect with OData” tool. You’ll be presented with a list of URLs (one for each table in your dataset).

Copy the URL for the table of interest. Then nip over to Tableau, select “Data” > “Connect to Data” > “OData”, and paste in the URL. Simple as that.

The OData connection is fast and robust – so far we’ve tried it on datasets with up to a million rows, and after a few minutes, the whole lot was downloaded and ready to visualise in Tableau. The best bit is that dates and Null values come through just fine, with zero configuration.

The “Connect with OData” tool is available to all paying ScraperWiki users, as well as journalists on our free 20-dataset journalist plan.

odata-tool-logos

If you’re a Tableau user, try it out, and let us know what you think. It’ll work with all versions of Tableau, including Tableau Public.

]]>
https://blog.scraperwiki.com/2014/03/publish-your-data-to-tableau-with-odata/feed/ 2 758221163