Skip to main content

This is a scraping tool that retrieves historical data from the continuous Spanish stock market from Investing.com, converting into a pandas DataFrame.

None

Project description

Investing Scraper of historical data from continuous spanish stock market

Python Version PyPi Version Build Status

Introduction

Since Investing does not have an API to retrieve historical data of the Continuous Spanish Stock Market, I decided to develop a scrapper to retrieve that information.

I developed this scrapper in order to get the data from Investing for my Final Degree Project at the University of Salamanca titled "Machine Learning for stock investment recommendation systems".

To sum up this is not the final version of this scrapper since this is just the pre-alpha version of it. So I will continue scrapping information indexed in investing so you can be able to retrieve more data, as soon as I can.

Installation

In order to get this package working you will need to install investpy from PyPi via Terminal:

pip install investpy

All the dependencies are already listed on the setup file of the package, but to sum it up, you will need this requirements:

Use

Currently you just have two possible options to retrieve data with this scrapper:

  • Retrieve the recent data of a stock: it retrieves the historical data from a stock from the last month. The function also checks if the introduced equity name is correct and then retrieves the data.
import investpy as ivs

df = ivs.get_recent_data('bbva')
  • Retrieve the historical data of a stock from a specific range of time: it retrieves the historical data from a stock from a range of time between the start date and the end date, specified in dd/mm/YY format. This function also checks is the introduced equity name is correct and then retrieves the data.
import investpy as ivs

df = ivs.get_historical_data('bbva', '10/10/2018', '10/12/2018')

You can check all the available equities for the Spanish Stock Market in this list from Investing: https://es.investing.com/equities/spain

(NOTE: you will need an active HTTP connection in order to get the scrapper working. As a temporary solution, you can just store the retrieved pandas.DataFrame in a CSV so you can work with that data offline.)

Future Work Ideas

Information

For further information or any question feel free to contact me via email at alvarob96@usal.es

Disclaimer: this is just for personal use, I am not related at all with Investing or any similar company. This is just a tool for the research project I am working on. I get no profit or economic benefit from this scrapper.

Project details

None

Download files

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

Source Distribution

investpy-0.4.tar.gz (15.6 kB view hashes)

Uploaded Source

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