Example #1
0
def fetch_appl():
    """Returns stock prices for Apple company."""
    yql = YQL('AAPL', '2014-01-01', '2014-01-10')

    for item in yql:
        print item.get('date'), item.get('price')

    yql.select('AAPL', '2014-01-01', '2014-01-10')

    for item in yql:
        print item.get('date'), item.get('price')
Example #2
0
def fetch_googl():
    """Returns stock prices for Google company."""
    yql = YQL('GOOGL', '2014-01-01', '2014-01-10')

    for item in yql:
        print item.get('date'), item.get('price')

    yql.select('GOOGL', '2014-01-01', '2014-01-10')

    for item in yql:
        print item.get('date'), item.get('price')
Example #3
0
    def test_appl(self):
        yql_data = YQL.select('AAPL', '2014-01-10', '2014-01-10')

        self.assertEqual(YQL.to_date('2014-01-10'), yql_data[0].get('date'))
        self.assertEqual('73.629744', yql_data[0].get('price'))

        yql_data = YQL('AAPL', '2014-01-10', '2014-01-10')

        self.assertEqual(YQL.to_date('2014-01-10'), yql_data[0].get('date'))
        self.assertEqual('73.629744', yql_data[0].get('price'))
Example #4
0
    def test_appl(self):
        yql_data = YQL.select('AAPL', '2014-01-10', '2014-01-10')

        self.assertEqual(YQL.to_date('2014-01-10'), yql_data[0].get('date'))
        self.assertEqual('74.57', yql_data[0].get('price'))

        yql_data = YQL('AAPL', '2014-01-10', '2014-01-10')

        self.assertEqual(YQL.to_date('2014-01-10'), yql_data[0].get('date'))
        self.assertEqual('74.57', yql_data[0].get('price'))
Example #5
0
    def test_appl(self):
        yql_data = YQL.select("AAPL", "2014-01-10", "2014-01-10")

        self.assertEqual(YQL.to_date("2014-01-10"), yql_data[0].get("date"))
        self.assertEqual("74.57", yql_data[0].get("price"))

        yql_data = YQL("AAPL", "2014-01-10", "2014-01-10")

        self.assertEqual(YQL.to_date("2014-01-10"), yql_data[0].get("date"))
        self.assertEqual("74.57", yql_data[0].get("price"))