Skip to content

Commit 8748aaa

Browse files
committed
deploy: 7f96dd6
1 parent f29bb2a commit 8748aaa

34 files changed

Lines changed: 2156 additions & 338 deletions

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 546cd7f94d796abdaf827732349ec4cb
3+
config: 6db25bec8764d90dbb06f1a0948ca739
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_images/currency1.png

44.9 KB
Loading

_images/sgs1.png

52.4 KB
Loading

_sources/api.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
API
3+
===
4+
5+
.. automodule:: bcb
6+
7+
.. autosummary::
8+
:toctree: generated
9+
10+
bcb.sgs
11+
bcb.currency

_sources/currency.rst.txt

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
Moedas
2-
======
2+
######
33

44
O módulo ``currency`` obtem dados de moedas do conversor de moedas do Banco Central através de webscraping.
55

6-
.. automodule:: bcb.currency
6+
.. autofunction:: bcb.currency.get
7+
8+
9+
.. ipython:: python
10+
11+
from bcb import currency
12+
df = currency.get(['USD', 'EUR'], start='2000-01-01', end='2021-01-01', side='ask')
13+
df.head()
14+
15+
.. ipython:: python
16+
17+
df.plot(figsize=(12, 6));
18+
19+
.. plot:: plots/currency1.py
20+
21+
22+
.. autofunction:: bcb.currency.get_currency_list
23+
24+
25+
.. ipython:: python
26+
27+
currency.get_currency_list().head()
728
8-
.. autodata:: get(symbols, start, end, side='ask', groupby='symbol')

_sources/examples.rst.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
bcb.currency
2+
============
3+
4+
.. automodule:: bcb.currency
5+
6+
7+
8+
9+
10+
11+
12+
.. rubric:: Functions
13+
14+
.. autosummary::
15+
16+
get
17+
get_currency_list
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+

_sources/generated/bcb.sgs.rst.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
bcb.sgs
2+
=======
3+
4+
.. automodule:: bcb.sgs
5+
6+
7+
8+
9+
10+
11+
12+
.. rubric:: Functions
13+
14+
.. autosummary::
15+
16+
get
17+
18+
19+
20+
21+
22+
.. rubric:: Classes
23+
24+
.. autosummary::
25+
26+
SGSCode
27+
28+
29+
30+
31+
32+
33+
34+
35+

_sources/index.rst.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Módulos
4949
Uso
5050
===
5151

52-
.. ipython::python
52+
.. ipython:: python
5353
5454
from bcb import sgs
5555
sgs.get(('IPCA', 433), last=12)
@@ -62,12 +62,11 @@ Uso
6262

6363
sgs.md
6464
currency.rst
65-
examples.rst
65+
api.rst
6666

6767

6868
Índices e tabelas
6969
==================
7070

7171
* :ref:`genindex`
72-
* :ref:`modindex`
73-
* :ref:`search`
72+
* :ref:`modindex`

_sources/sgs.rst.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@ SGS
33

44
O módulo ``sgs`` obtem os dados do webservice do Banco Central.
55

6-
.. automodule:: bcb.sgs
6+
.. autofunction:: bcb.sgs.get
77

8-
.. autodata:: get(codes, start=None, end=None, last=0, multi=True)
8+
9+
.. ipython:: python
10+
11+
from bcb import sgs
12+
import matplotlib.pyplot as plt
13+
import matplotlib as mpl
14+
mpl.style.use('bmh')
15+
16+
df = sgs.get({'IPCA': 433}, start='2002-02-01')
17+
df.index = df.index.to_period('M')
18+
df.head()
19+
20+
.. ipython:: python
21+
22+
dfr = df.rolling(12)
23+
i12 = dfr.apply(lambda x: (1 + x/100).prod() - 1).dropna() * 100
24+
i12.head()
25+
26+
.. ipython:: python
27+
28+
i12.plot(figsize=(12,6))
29+
plt.title('Fonte: https://dadosabertos.bcb.gov.br', fontsize=10)
30+
plt.suptitle('IPCA acumulado 12 meses - Janela Móvel', fontsize=18)
31+
plt.xlabel('Data')
32+
plt.ylabel('%')
33+
plt.legend().set_visible(False)
34+
35+
.. plot:: plots/sgs1.py

0 commit comments

Comments
 (0)