Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickelkr/yfi
Yahoo! YQL library.
https://github.com/nickelkr/yfi
Last synced: about 2 months ago
JSON representation
Yahoo! YQL library.
- Host: GitHub
- URL: https://github.com/nickelkr/yfi
- Owner: nickelkr
- License: mit
- Created: 2016-01-24T23:33:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-12T01:56:53.000Z (almost 9 years ago)
- Last Synced: 2024-10-29T01:19:57.779Z (2 months ago)
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.txt
Awesome Lists containing this project
- awesome-quant - yfi - Yahoo! YQL library. (Python / Data Sources)
- awesome-quant - yfi - Yahoo! YQL library. (Python / Data Sources)
README
# YFi
[![Build Status](https://travis-ci.org/nickelkr/yfi.svg?branch=master)](https://travis-ci.org/nickelkr/yfi)Yahoo! YQL library with tools focusing on the finance portion (eventually).
**Description**
YFi allows you to create and run queries against Yahoo's YQL datatables.
It is currently in the beginning stages and supports the following YQL statments:
- select
- where
- in (_in)
- and (_and)
- equal (eq)You can also set YQL variables, the following of which are supported:
- store
- table
- endpoint
- formatThe plan is to also provide tools to use specifically with the finance tables.
**Usage**
The following is a example that returns all the data from the yahoo.finance.quotes table for the symbols 'TSLA' and 'GOOG'
```python
from yfi.yql import Yql
# create a Yql object
y = Yql()
# this object supports chaining so we can build our query in one line. select() defaults to '*'
y.select().where('symbol')._in('TSLA', 'GOOG')
# the exec() method returns a json object unless format has been changed otherwise
j = y.run()
```
The following is a shortcut for the above. It will select('*') from whatever table is set (default: yahoo.finance.quotes)
for the given symbol(s)
```python
from yfi.yql import Yql
y = Yql()
y.symbol('TSLA', 'GOOG')
j = y.run()
```
**Upcoming Features**- Better error handling
- Processing of the JSON response into a class that provides facilities for applying analytics easily
- Support for API tokens
- Stored queries
- Interval execution**Running Tests**
To run all tests:
python -m unittest discoverTo run just Yql:
python -m unittest test.TestYql