Skip to content

Commit

Permalink
add debug arg & generated docs
Browse files Browse the repository at this point in the history
- debug argument has been added in order to solve issue #18 using logging interface
- docs generated via windows with make.bat file
- requirements updated and so on requirements.txt modified
- user_agent.py minor fix when file was empty
- code-cov improvement
  • Loading branch information
Álvaro Bartolomé del Canto committed Aug 19, 2019
1 parent f655fa0 commit 7c95ce8
Show file tree
Hide file tree
Showing 59 changed files with 1,859 additions and 505 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ python:
dist: xenial

install:
- pip install pandas==0.24.2
- pip install pandas==0.25.0
- pip install requests==2.22.0
- pip install lxml==4.3.3
- pip install Unidecode==1.0.23
- pip install investpy==0.8.7
- pip install pytest==4.5.0
- pip install lxml==4.4.1
- pip install Unidecode==1.1.1
- pip install investpy==0.8.8
- pip install pytest==5.1.0
- pip install codecov==2.0.15
- pip install pytest-cov==2.7.1

Expand Down
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ investpy seeks to be one of the most used Python packages when it comes to histo

In order to get this package working you will need to install [**investpy**](https://pypi.org/project/investpy/) using pip on the terminal by typing:

``$ pip install investpy==0.8.7``
``$ pip install investpy==0.8.8``

Every package used is listed in [requirements.txt](https://github.com/alvarob96/investpy/blob/master/requirements.txt) file, which can also be installed via pip:

Expand All @@ -40,7 +40,7 @@ As the main functionality is based on historical data retrieval, the usage of ev
```python
import investpy

df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending')
df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending', debug=False)
print(df.head())

>>>
Expand All @@ -51,8 +51,11 @@ Date
2019-07-16 4.971 5.008 4.913 4.947 30730000
2019-07-17 4.905 4.965 4.900 4.952 22410000
2019-07-18 4.856 4.894 4.812 4.879 35820000
```
```python
import investpy

df = investpy.get_historical_data(equity='bbva', from_date='01/01/2018', to_date='12/08/2019', as_json=False, order='ascending')
df = investpy.get_historical_data(equity='bbva', from_date='01/01/2018', to_date='12/08/2019', as_json=False, order='ascending', debug=False)
print(df.head())

>>>
Expand All @@ -70,7 +73,7 @@ Date
```python
import investpy

df = investpy.get_fund_recent_data(fund='bbva plan multiactivo moderado pp', as_json=False, order='ascending')
df = investpy.get_fund_recent_data(fund='bbva plan multiactivo moderado pp', as_json=False, order='ascending', debug=False)
print(df.head())

>>>
Expand All @@ -81,8 +84,12 @@ Date
2019-07-16 1.130 1.130 1.130 1.130
2019-07-17 1.129 1.129 1.129 1.129
2019-07-18 1.126 1.126 1.126 1.126
```

df = investpy.get_fund_historical_data(fund='bbva plan multiactivo moderado pp', from_date='01/01/2018', to_date='12/08/2019', as_json=False, order='ascending')
```python
import investpy

df = investpy.get_fund_historical_data(fund='bbva plan multiactivo moderado pp', from_date='01/01/2018', to_date='12/08/2019', as_json=False, order='ascending', debug=False)
print(df.head())

>>>
Expand All @@ -100,7 +107,7 @@ Date
```python
import investpy

df = investpy.get_etf_recent_data(etf='bbva accion dj eurostoxx 50', as_json=False, order='ascending')
df = investpy.get_etf_recent_data(etf='bbva accion dj eurostoxx 50', as_json=False, order='ascending', debug=False)
print(df.head())

>>>
Expand All @@ -111,8 +118,12 @@ Date
2019-07-16 36.040 36.085 35.835 35.845
2019-07-17 35.830 36.080 35.810 35.965
2019-07-18 35.640 35.785 35.515 35.515
```

```python
import investpy

df = investpy.get_etf_historical_data(etf='bbva accion dj eurostoxx 50', from_date='01/01/2018', to_date='12/08/2019', as_json=False, order='ascending')
df = investpy.get_etf_historical_data(etf='bbva accion dj eurostoxx 50', from_date='01/01/2018', to_date='12/08/2019', as_json=False, order='ascending', debug=False)
print(df.head())

>>>
Expand Down Expand Up @@ -148,7 +159,8 @@ import investpy
fund_information = investpy.get_fund_information(fund='bbva plan multiactivo moderado pp', as_json=True)
print(fund_information)

>>> {'Fund Name': 'Bbva Plan Multiactivo Moderado Pp',
>>> {
'Fund Name': 'Bbva Plan Multiactivo Moderado Pp',
'Rating': '4',
'1-Year Change': '-1,19%',
'Previous Close': '1.103',
Expand All @@ -163,7 +175,8 @@ print(fund_information)
'Expenses': 'N/A',
'Min Investment': '30',
'Market Cap': '34820000000',
'Category': 'Mixtos Euros Moderados PP'}
'Category': 'Mixtos Euros Moderados PP'
}
```

## Contribute - [![Open Source Helpers](https://www.codetriage.com/alvarob96/investpy/badges/users.svg)](https://www.codetriage.com/alvarob96/investpy)
Expand Down
Binary file modified docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/disclaimer.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/equities.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/equities_api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/etfs_api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/funds_api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/information.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/introduction.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/main_api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/model.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 97a01e1d03a1e0b89532148ecd198ed5
config: aae0ab10b00495dd3c5f1098fa8d43dd
tags: 645f666f9bcd5a90fca523b33c5a78b7
3 changes: 2 additions & 1 deletion docs/_build/html/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ API Reference
main_api.rst
equities_api.rst
funds_api.rst
etfs_api.rst
etfs_api.rst
user_agent.rst
6 changes: 3 additions & 3 deletions docs/_build/html/_sources/equities.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ protect investors from fraudulent practices. Historically, they have outperforme
run. These investments can be purchased from most online stock brokers.

In this case, historical data from stocks or equities is retrieved from `Investing Equities <https://es.investing.com/equities/spain>`_
just for the Spanish Stock Market, on the current release 0.8.7.
just for the Spanish Stock Market, on the current release 0.8.8.

Getting Started
---------------
Expand Down Expand Up @@ -54,10 +54,10 @@ have been developed in order to retrieve both recent and historical data between
So on an example is proposed in order to clarify the use of investpy for historical data retrieval::

# Retrieves the recent data of BBVA (last month) as a pandas.DataFrame on ascending order
df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending')
df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending', debug=False)

# Retrieves the historical data of BBVA on the specified date range as a pandas.DataFrame on ascending order
df = investpy.get_historical_data(equity='bbva', start='01/01/2010', end='01/01/2019', as_json=False, order='ascending')
df = investpy.get_historical_data(equity='bbva', from_date='01/01/2010', to_date='01/01/2019', as_json=False, order='ascending', debug=False)

As we already saw, both functions take a lot of parameters, but some of them are *optional* which means that the function
does not need the user to specify them.
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_sources/installation.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ it will install the following dependencies:

.. note::

After installing the package you are now available to use it! As investpy's latest release is 0.8.7 the installation is
After installing the package you are now available to use it! As investpy's latest release is 0.8.8 the installation is
optimized for it. If you try installing another investpy release, some features may not work.
2 changes: 1 addition & 1 deletion docs/_build/html/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Installation

.. note::

After installing the package you are now available to use it! As investpy's latest release is 0.8.7 the installation is
After installing the package you are now available to use it! As investpy's latest release is 0.8.8 the installation is
optimized for it. If you try installing another investpy release, some features may not work.

First Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_sources/introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Reference. So a block of code in order to get to test investpy usage is presente
equities = investpy.get_equities_list()

# Retrieve the recent historical data (past month) of an equity as a pandas.DataFrame on ascending date order
df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending')
df = investpy.get_recent_data(equity='bbva', as_json=False, order='ascending', debug=False)

# Retrieve the company profile of the introduced equity on english
profile = investpy.get_company_profile(equity='bbva', language='english')
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.8.7',
VERSION: '0.8.8',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
6 changes: 4 additions & 2 deletions docs/_build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>API Reference &mdash; investpy 0.8.7 documentation</title>
<title>API Reference &mdash; investpy 0.8.8 documentation</title>



Expand Down Expand Up @@ -60,7 +60,7 @@


<div class="version">
0.8.7
0.8.8
</div>


Expand Down Expand Up @@ -95,6 +95,7 @@
<li class="toctree-l2"><a class="reference internal" href="equities_api.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.equities</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="funds_api.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.funds</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="etfs_api.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.etfs</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="user_agent.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.user_agent</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="information.html">Additional Information</a></li>
Expand Down Expand Up @@ -171,6 +172,7 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
<li class="toctree-l1"><a class="reference internal" href="equities_api.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.equities</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="funds_api.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.funds</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="etfs_api.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.etfs</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="user_agent.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">investpy.user_agent</span></code></a></li>
</ul>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/contribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Contribute to investpy - &mdash; investpy 0.8.7 documentation</title>
<title>Contribute to investpy - &mdash; investpy 0.8.8 documentation</title>



Expand Down Expand Up @@ -58,7 +58,7 @@


<div class="version">
0.8.7
0.8.8
</div>


Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/disclaimer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Disclaimer &mdash; investpy 0.8.7 documentation</title>
<title>Disclaimer &mdash; investpy 0.8.8 documentation</title>



Expand Down Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.8.7
0.8.8
</div>


Expand Down
10 changes: 5 additions & 5 deletions docs/_build/html/equities.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Stocks/Equities &mdash; investpy 0.8.7 documentation</title>
<title>Stocks/Equities &mdash; investpy 0.8.8 documentation</title>



Expand Down Expand Up @@ -60,7 +60,7 @@


<div class="version">
0.8.7
0.8.8
</div>


Expand Down Expand Up @@ -175,7 +175,7 @@ <h1>Stocks/Equities<a class="headerlink" href="#stocks-equities" title="Permalin
protect investors from fraudulent practices. Historically, they have outperformed most other investments over the long
run. These investments can be purchased from most online stock brokers.</p>
<p>In this case, historical data from stocks or equities is retrieved from <a class="reference external" href="https://es.investing.com/equities/spain">Investing Equities</a>
just for the Spanish Stock Market, on the current release 0.8.7.</p>
just for the Spanish Stock Market, on the current release 0.8.8.</p>
<div class="section" id="getting-started">
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline"></a></h2>
<p>To get started using <a class="reference external" href="https://pypi.org/project/investpy/">investpy</a> you first need to install it as described on
Expand Down Expand Up @@ -211,10 +211,10 @@ <h3>Recent &amp; Historical Data<a class="headerlink" href="#recent-historical-d
have been developed in order to retrieve both recent and historical data between a date range.</p>
<p>So on an example is proposed in order to clarify the use of investpy for historical data retrieval:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Retrieves the recent data of BBVA (last month) as a pandas.DataFrame on ascending order</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">investpy</span><span class="o">.</span><span class="n">get_recent_data</span><span class="p">(</span><span class="n">equity</span><span class="o">=</span><span class="s1">&#39;bbva&#39;</span><span class="p">,</span> <span class="n">as_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s1">&#39;ascending&#39;</span><span class="p">)</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">investpy</span><span class="o">.</span><span class="n">get_recent_data</span><span class="p">(</span><span class="n">equity</span><span class="o">=</span><span class="s1">&#39;bbva&#39;</span><span class="p">,</span> <span class="n">as_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s1">&#39;ascending&#39;</span><span class="p">,</span> <span class="n">debug</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="c1"># Retrieves the historical data of BBVA on the specified date range as a pandas.DataFrame on ascending order</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">investpy</span><span class="o">.</span><span class="n">get_historical_data</span><span class="p">(</span><span class="n">equity</span><span class="o">=</span><span class="s1">&#39;bbva&#39;</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="s1">&#39;01/01/2010&#39;</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">&#39;01/01/2019&#39;</span><span class="p">,</span> <span class="n">as_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s1">&#39;ascending&#39;</span><span class="p">)</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">investpy</span><span class="o">.</span><span class="n">get_historical_data</span><span class="p">(</span><span class="n">equity</span><span class="o">=</span><span class="s1">&#39;bbva&#39;</span><span class="p">,</span> <span class="n">from_date</span><span class="o">=</span><span class="s1">&#39;01/01/2010&#39;</span><span class="p">,</span> <span class="n">to_date</span><span class="o">=</span><span class="s1">&#39;01/01/2019&#39;</span><span class="p">,</span> <span class="n">as_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s1">&#39;ascending&#39;</span><span class="p">,</span> <span class="n">debug</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</pre></div>
</div>
<p>As we already saw, both functions take a lot of parameters, but some of them are <em>optional</em> which means that the function
Expand Down
Loading

0 comments on commit 7c95ce8

Please sign in to comment.