Skip to content

Commit d19de48

Browse files
author
Álvaro Bartolomé del Canto
authored
Update README.md
1 parent f5a2ef4 commit d19de48

File tree

1 file changed

+140
-20
lines changed

1 file changed

+140
-20
lines changed

README.md

Lines changed: 140 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# investpy — Python package for stock historical data extraction from Investing
1+
# investpy — a Python package for financial historical data extraction from Investing
22

33
[![Python Version](https://img.shields.io/pypi/pyversions/investpy.svg)](https://pypi.org/project/investpy/)
44
[![PyPi Version](https://img.shields.io/pypi/v/investpy.svg)](https://pypi.org/project/investpy/)
@@ -11,11 +11,11 @@
1111

1212
## Introduction
1313

14-
Since [**Investing**](https://es.investing.com/) does not have an API, I decided to develop this Python scraper in order to retrieve historical data from the companies that integrate the **Continuous Spanish Stock Market**. The scraper is a Python package everyone can use through PyPi (Python Package Installer) via [investpy](https://pypi.org/project/investpy/).
14+
investpy is a Python package to retrieve real-time historical data from [Investing](https://www.investing.com/) mainly
15+
of spanish financial products, but it is intended to be scalable and so on, work with world financial products such as
16+
equities, funds, ETFs or currencies.
1517

16-
The main purpose of developing this package was to use it as the **Data Extraction** tool for its namesake section, for my Final Degree Project at the University of Salamanca titled "**Machine Learning for stock investment recommendation systems**". The package end up being so consistent, reliable and usable that it is going to be used as the main Data Extraction tool by another students in their Final Degree Projects named "*Recommender system of banking products*" and "*Robo-Advisor Application*".
17-
18-
To conclude this section, I am in the need to specify that this is not the final version of the package, this is just a beta version of it that will keep going while I develop a consistent Python package for financial data extraction.
18+
investpy seeks to be one of the most used Python packages when it comes to historical data extraction from financial products, so to stop depending on public/private APIs, as investpy is **free** and has **no limitations**, features that lead investpy to be one of the most strong and consistent packages of financial data retrieval.
1919

2020
## Installation
2121

@@ -30,33 +30,153 @@ All the dependencies are already listed on the setup file of the package, but to
3030
* [**lxml 4.3.3**](https://pypi.org/project/lxml/)
3131
* [**unidecode 1.0.23**](https://pypi.org/project/unidecode/)
3232

33-
## Documentation
33+
## Usage
3434

35-
[investpy - Read the Docs](https://investpy.readthedocs.io/)
35+
Eventhough some investpy usage examples are shown on the [docs](https://investpy.readthedocs.io/equities.html), some basic functionality will be sorted out with sample Python code blocks.
3636

37-
## Contribute to investpy - [![Open Source Helpers](https://www.codetriage.com/alvarob96/investpy/badges/users.svg)](https://www.codetriage.com/alvarob96/investpy)
37+
### Recent/Historical Data
3838

39-
As this is an open source project it is open to contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas.
39+
As the main functionality is based on historical data retrieval, the usage of every function will be explained so to ease the user the use of investpy, which is mainly intended for historical data extraction, which means that every other function is additional.
4040

41-
Also there is an open tab of [issues](https://github.com/alvarob96/investpy/issues) where anyone can contribute opening new issues if needed or navigate through them in order to solve them or contribute to its solving.
41+
#### Equity Data Retrieval
4242

43-
Additionally, you can triage issues on [investpy CodeTriage](https://www.codetriage.com/alvarob96/investpy) so you can provide issues so the package can grow and improve as the issues solves bugs, problems or needs, and maybe provide new ideas to improve package functionality and efficiency.
43+
```python
44+
import investpy
4445

45-
Feel free to contact package administrator via [email]([email protected])!
46+
df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending')
47+
print(df.head())
4648

47-
## License
49+
>>>
50+
Close High Low Open Volume
51+
Date
52+
2019-07-12 4.897 4.985 4.897 4.952 22930000
53+
2019-07-15 4.926 4.941 4.873 4.915 14830000
54+
2019-07-16 4.971 5.008 4.913 4.947 30730000
55+
2019-07-17 4.905 4.965 4.900 4.952 22410000
56+
2019-07-18 4.856 4.894 4.812 4.879 35820000
4857

49-
[MIT License](https://github.com/alvarob96/investpy/blob/master/LICENSE)
58+
df = investpy.get_historical_data(equity='bbva', start='01/01/2018', end='12/08/2019', as_json=False, order='ascending')
59+
print(df.head())
5060

51-
## Additional Information
61+
>>>
62+
Close High Low Open Volume
63+
Date
64+
2018-01-02 7.082 7.169 7.050 7.139 15960000
65+
2018-01-03 7.094 7.120 7.055 7.113 13320000
66+
2018-01-04 7.221 7.274 7.104 7.113 20790000
67+
2018-01-05 7.253 7.282 7.203 7.259 13580000
68+
2018-01-08 7.235 7.293 7.220 7.274 13420000
69+
```
70+
71+
#### Fund Data Retrieval
72+
73+
```python
74+
import investpy
75+
76+
df = investpy.get_fund_recent_data(fund='bbva plan multiactivo moderado pp', as_json=False, order='ascending')
77+
print(df.head())
78+
79+
>>>
80+
Close High Low Open
81+
Date
82+
2019-07-12 1.128 1.128 1.128 1.128
83+
2019-07-15 1.130 1.130 1.130 1.130
84+
2019-07-16 1.130 1.130 1.130 1.130
85+
2019-07-17 1.129 1.129 1.129 1.129
86+
2019-07-18 1.126 1.126 1.126 1.126
87+
88+
df = investpy.get_fund_historical_data(fund='bbva plan multiactivo moderado pp', start='01/01/2018', end='12/08/2019', as_json=False, order='ascending')
89+
print(df.head())
90+
91+
>>>
92+
Close High Low Open
93+
Date
94+
2018-02-15 1.105 1.105 1.105 1.105
95+
2018-02-16 1.113 1.113 1.113 1.113
96+
2018-02-17 1.113 1.113 1.113 1.113
97+
2018-02-18 1.113 1.113 1.113 1.113
98+
2018-02-19 1.111 1.111 1.111 1.111
99+
```
100+
101+
#### ETF Data Retrieval
102+
103+
```python
104+
import investpy
105+
106+
df = investpy.get_etf_recent_data(etf='bbva accion dj eurostoxx 50', as_json=False, order='ascending')
107+
print(df.head())
108+
109+
>>>
110+
Close High Low Open
111+
Date
112+
2019-07-12 35.795 35.870 35.825 35.825
113+
2019-07-15 35.855 35.930 35.760 35.875
114+
2019-07-16 36.040 36.085 35.835 35.845
115+
2019-07-17 35.830 36.080 35.810 35.965
116+
2019-07-18 35.640 35.785 35.515 35.515
117+
118+
df = investpy.get_etf_historical_data(etf='bbva accion dj eurostoxx 50', start='01/01/2018', end='12/08/2019', as_json=False, order='ascending')
119+
print(df.head())
120+
121+
>>>
122+
Close High Low Open
123+
Date
124+
2018-01-02 34.995 35.155 34.860 35.155
125+
2018-01-03 35.210 35.305 35.020 35.105
126+
2018-01-04 35.825 35.710 35.465 35.465
127+
2018-01-05 36.185 36.180 35.900 35.900
128+
2018-01-08 36.280 36.370 36.240 36.325
129+
```
130+
131+
### Additional Data
132+
133+
As Investing provides more data apart from historical data, some of that data is fetched via investpy if it is considered to be useful. So on, some additional information is retrieved for both equities and funds such as company profiles or inner basic information for equities and funds, respectively as shown below.
134+
135+
#### Equity Company Profile Retrieval
136+
137+
```python
138+
import investpy
139+
140+
company_profile = investpy.get_equity_company_profile(equity='bbva', language='en')
141+
print(company_profile)
142+
143+
>>> "Banco Bilbao Vizcaya Argentaria, S.A. (BBVA) is a diversified financial company engaged in retail banking ..."
144+
```
145+
146+
#### Fund Additional Information Retrieval
147+
148+
```python
149+
import investpy
150+
151+
fund_information = investpy.get_fund_information(fund='bbva plan multiactivo moderado pp', as_json=True)
152+
print(fund_information)
153+
154+
>>> {'Fund Name': 'Bbva Plan Multiactivo Moderado Pp',
155+
'Rating': '4',
156+
'1-Year Change': '-1,19%',
157+
'Previous Close': '1.103',
158+
'Risk Rating': '1',
159+
'TTM Yield': '0%',
160+
'ROE': '14,02%',
161+
'Issuer': 'BBVA Pensiones EGFP',
162+
'Turnover': 'N/A',
163+
'ROA': '4,97%',
164+
'Inception Date': '2012-10-16 00:00:00',
165+
'Total Assets': '1670000000',
166+
'Expenses': 'N/A',
167+
'Min Investment': '30',
168+
'Market Cap': '34820000000',
169+
'Category': 'Mixtos Euros Moderados PP'}
170+
```
171+
172+
## Contribute - [![Open Source Helpers](https://www.codetriage.com/alvarob96/investpy/badges/users.svg)](https://www.codetriage.com/alvarob96/investpy)
52173

53-
The package is currently in a development version, so please, if needed open an [issue](https://github.com/alvarob96/investpy/issues) to solve all the possible problems the package may be causing
54-
so I fix them as fast as I can. Also, any new ideas or proposals are welcome, and I will gladly implement them in the package if the are positive and useful.
174+
As this is an open source project it is open to contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas.
55175

56-
For further information or any question feel free to contact me via email at [email protected]
176+
Also there is an open tab of [issues](https://github.com/alvarob96/investpy/issues) where anyone can contribute opening new issues if needed or navigate through them in order to solve them or contribute to its solving.
57177

58-
You can also check my [Medium Publication](https://medium.com/research-studies-by-alvaro-bartolome/investpy-a-python-library-for-historical-data-extraction-from-the-spanish-stock-market-ad4d564dbfc5), where I upload weekly posts related to Data Science and some of them explain investpy functions and development in a deeper way.
178+
Additionally, you can triage issues on [investpy CodeTriage](https://www.codetriage.com/alvarob96/investpy) so you can provide issues so the package can grow and improve as the issues solves bugs, problems or needs, and maybe provide new ideas to improve package functionality and efficiency.
59179

60180
## Disclaimer
61181

62-
This Python Package has been made for research purposes in order to fit a needs that Investing.com does not cover, so this package works like an Application Programming Interface (API) of Investing.com developed in an altruistic way. Conclude that this package is not related in any way with Investing.com or any dependant company, the only requirement for developing this package was to mention the source where data is retrieved.
182+
This Python package has been made for research purposes in order to fit the needs that Investing.com does not cover, so this package works like an Application Programming Interface (API) of Investing.com developed in an altruistic way. Conclude that this package is not related in any way with Investing.com or any dependant company, the only requirement specified by Investing in order to develop this package was "*mention the source where data is retrieved from*".

0 commit comments

Comments
 (0)