GithubHelp home page GithubHelp logo

stockex's Introduction

Stockex

Build Status Coverage Status Code Health 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.