Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

Stockex

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Stockex

Python 3 wrapper for Yahoo! Finance API

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

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 and Docs.

License

Public Domain.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc