Metadata-Version: 2.1
Name: pyvalet
Version: 0.1
Summary: BoC Valet API Wrapper
Home-page: https://github.com/tylercroberts/pyvalet
Author: Tyler Roberts
Author-email: tcroberts@live.ca
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: pandas
Requires-Dist: requests
Requires-Dist: loguru
Provides-Extra: docs
Requires-Dist: sphinx (<2.0,>=1.6.3); extra == 'docs'
Requires-Dist: sphinx-rtd-theme (==0.4.1); extra == 'docs'
Requires-Dist: nbsphinx (==0.3.4); extra == 'docs'
Requires-Dist: nbstripout (==0.3.3); extra == 'docs'
Requires-Dist: recommonmark (==0.5.0); extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints (==1.6.0); extra == 'docs'
Requires-Dist: sphinx-copybutton (==0.2.5); extra == 'docs'
Requires-Dist: jupyter-client (<6.0,>=5.1.0); extra == 'docs'
Requires-Dist: tornado (<6.0,>=4.2); extra == 'docs'
Requires-Dist: ipykernel (<5.0,>=4.8.1); extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest (==5.2.1); extra == 'tests'
Requires-Dist: pytest-cov (==2.8.1); extra == 'tests'
Requires-Dist: coverage-badge; extra == 'tests'
Requires-Dist: coveralls; extra == 'tests'

# pyvalet
![](https://travis-ci.com/tylercroberts/pyvalet.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/tylercroberts/pyvalet/badge.svg?branch=master)](https://coveralls.io/github/tylercroberts/pyvalet?branch=master)
![](https://img.shields.io/badge/Python-3.6%2C%203.7-blue)

Simple, pandas integrated API wrapper for the Bank of Canada Valet API.

Their documentation page can be found [here](https://www.bankofcanada.ca/valet/docs)

### Installation:
To install this package

### Getting Started:

To get started using `pyvalet`, simply open up a new python file and type:
```python
from pyvalet import ValetInterpreter

vi = ValetInterpreter()
```

This will be your interface with all the features of pyvalet.

To see what sort of data is available, try running one of the following commands:

```python
vi.list_series()

vi.list_groups()
```

These two commands will provide you with a `pandas` DataFrame containing all possible series, 
or groups to explore using the Valet API. The three fields output are 'name', 'label' and 'link'.

The first time you run these commands, the ValetInterpreter will cache them 
so there is no need to assign the output, unless you plan to filter these lists.

They can be accessed through:
```python
vi.series_list

vi.groups_list
```


To get more details about these series or groups, the `get_series_detail()` 
or `get_group_detail()` methods are available
```python
df = vi.get_series_detail("FXUSDCAD", response_format='csv')

df_group, df_series = vi.get_group_detail("FX_RATES_DAILY", response_format='csv')
```

The output of `.get_series_detail()` is  a `pandas` DataFrame containing, among other things, 
the name and description of a given series.

The output of `.get_group_detail()` is one `pandas` Series, and one DataFrame. The Series containing details
about the group itself, and the DataFrame containing the same information about all series in the group.

Diving even deeper, you can pull observations from these series or groups using the `get_series_observations()`
and `get_groups_observations()` methods.

```python
df_series, df = vi.get_series_observations("FXUSDCAD", response_format='csv')
df = vi.get_group_observations("FX_RATES_DAILY", response_format='csv')
```

Additional keyword arguments can be passed to alter the query. See the docstrings for more information.

Like the methods for group details, the output of `get_series_observations()` is one `pandas` Series, 
and one DataFrame. The Series contains the details for the series queries, 
and the DataFrame contains the observations themselves.

