Skip to content

Commit

Permalink
Merge 4498828 into 2aaeccc
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercroberts committed Dec 5, 2019
2 parents 2aaeccc + 4498828 commit 52928ab
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 46 deletions.
22 changes: 17 additions & 5 deletions README.md
@@ -1,5 +1,6 @@
# pyvalet
![](https://travis-ci.com/tylercroberts/pyvalet.svg?branch=master)
![](https://img.shields.io/pypi/v/pyvalet)
[![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)

Expand All @@ -21,8 +22,7 @@ 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:

### Series and Group Lists:
```python
vi.list_series()

Expand All @@ -42,6 +42,7 @@ vi.series_list
vi.groups_list
```

### Series and Group Details:

To get more details about these series or groups, the `get_series_detail()`
or `get_group_detail()` methods are available
Expand All @@ -57,6 +58,8 @@ 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.

### Series and Group Observations:

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

Expand All @@ -67,6 +70,15 @@ 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.
Like the methods for group details, the output of `get_series_observations()` is two `pandas` DataFrames,
The first contains the details for the series queries, and the second contains the observations themselves.


### RSS Feed for FX Rates:
`pyvalet` also offers an interface for pulling RSS feeds from the Valet API.

```python
vi.get_fx_rss("FXUSDCAD")
```

This command will accept any series name as an argument, and returns an XML string containing the RSS feed.
20 changes: 20 additions & 0 deletions docs/Makefile
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
56 changes: 56 additions & 0 deletions docs/source/conf.py
@@ -0,0 +1,56 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))


# -- Project information -----------------------------------------------------

project = 'pyvalet'
copyright = '2019, Tyler Roberts'
author = 'Tyler Roberts'

# The full version, including alpha/beta/rc tags
release = '2019'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.napoleon',
'sphinx.ext.autodoc']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
26 changes: 26 additions & 0 deletions docs/source/index.rst
@@ -0,0 +1,26 @@
.. pyvalet documentation master file, created by
sphinx-quickstart on Thu Dec 5 12:19:32 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to pyvalet's documentation!
===================================

`pyvalet` is a simple to use, `pandas` integrated API wrapper for the Bank of Canada's programmatic API Valet.

By using this module, you can jump right in to

.. toctree::
:maxdepth: 2
:caption: Contents:

pyvalet_api.rst



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
6 changes: 6 additions & 0 deletions docs/source/pyvalet_api.rst
@@ -0,0 +1,6 @@
`pyvalet` API Reference
=========================

.. module:: pyvalet
.. autoclass:: ValetInterpreter
:members:

0 comments on commit 52928ab

Please sign in to comment.