Skip to main content

Python 3 wrapper for Yahoo! Finance API

Project description

# Stockex

Python 3 wrapper for Yahoo! Finance API.



## Requirements

* Python 3



## Install

From PYPI:
```
pip install stockex
```

From Github:
```
git clone https://github.com/cttn/Stockex.git

cd Stockex

python setup.py install
```


## Example Usage

```
from stockex import stockwrapper as sw

data = sw.YahooData()

# Print Current data of a Stock
print(data.get_current(['GOOG']))

# Print historical data of a Stock, returns data of last week
print(data.get_historical("GOOG"))

# Print historical data of a Stock according to the startDate and endDate
print(data.get_historical('YHOO',['Open','Close','High','Low'],startDate='2014-09-11',endDate='2015-02-10',limit=5))

# Trivial formatting
print("Google stock: Date and Price")
for item in data.get_historical("GOOG"):
print(item['Date'] + '\t' + item['Close'])


# Other methods:

# Do a custom YQL query to Yahoo! Finance YQL API:
data.enquire('select * from yahoo.finance.quotes where symbol in ("GOOG", "C")')

# Get news feed of a Company
data.get_news_feed("GOOG")

# Get options data
data.get_options_info("GOOG")

# Get industry ids
data.get_industry_ids()

# Get industry index from a given id
data.get_industry_index('914')
```


## Contributing

Contributions of all sorts are welcomed.
Feel free to fork, make pull requests, ask for features, etc.


## Credits

Based on the Python2.7 (Public Domain) script StockScraper: [Code](https://github.com/gurch101/StockScraper) and [Docs](http://www.gurchet-rai.net/dev/yahoo-finance-yql).


## License

Public Domain.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Stockex-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file Stockex-0.1.2.tar.gz.

File metadata

  • Download URL: Stockex-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Stockex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e2d8384eb125a30002ea169a7efe1b418ee927043b4022a12403e615fb2687c5
MD5 8a283a1de57a8712da91eb5016ffddaf
BLAKE2b-256 b92ea00ee9a240c2aaba672ae1077ddbc145a11ce042a1e4d05010988c4391f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page