Skip to content

Commit

Permalink
Release v0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
apologist committed Sep 27, 2017
2 parents f452885 + 22f278b commit 5794f94
Show file tree
Hide file tree
Showing 23 changed files with 1,133 additions and 303 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
@@ -0,0 +1,12 @@
language: python

python:
- "3.5"
- "3.6"

install:
- pip install -r requirements/dev.pip
- python setup.py install

script:
- pytest
61 changes: 61 additions & 0 deletions README.md
@@ -0,0 +1,61 @@
<p align="center">
<em>Python http client to get market data from EodData Web Service.</em>
</p>

---

[![Build Status](https://travis-ci.org/apologist/eoddata-client.svg?branch=master)](https://travis-ci.org/apologist/eoddata-client)
[![Package version](https://badge.fury.io/py/eoddata-client.svg)](https://pypi.python.org/pypi/eoddata-client)


**Documentation**: [http://eoddata-client.readthedocs.io/](http://eoddata-client.readthedocs.io/)

**Requirements**: Python 3.5+, [requests](http://docs.python-requests.org/) and [pandas](http://pandas.pydata.org/)

## Quickstart

Install using `pip`:

```shell
$ pip install eoddata-client
```

Get data in pandas DataFrame:

```python
import os

from eoddata_client import EodDataHttpClient

client = EodDataHttpClient(os.environ['EOD_DATA_LOGIN'],
os.environ['EOD_DATA_PASSWORD'])

quotes = client.symbol_history('nasdaq', 'msft', datetime.date(1992, 1, 1))
quotes['Diff'] = quotes['Close'].shift(1) - quotes['Close']
print(quotes.tail())

# Symbol Open High Low Close Volume Diff
# 2017-09-20 MSFT 75.35 75.55 74.31 74.94 21587800 0.50
# 2017-09-21 MSFT 75.11 75.24 74.11 74.21 19186100 0.73
# 2017-09-22 MSFT 73.99 74.51 73.85 74.41 14111300 -0.20
# 2017-09-25 MSFT 74.09 74.25 72.92 73.26 24149100 1.15
# 2017-09-26 MSFT 73.67 73.81 72.99 73.26 18019500 0.00
```

Or as regular collection of objects:

```python
import os

from eoddata_client import EodDataHttpClient

client = EodDataHttpClient(os.environ['EOD_DATA_LOGIN'],
os.environ['EOD_DATA_PASSWORD'])

quotes = client.symbol_history('nasdaq', 'msft', datetime.date(1992, 1, 1))
print(quotes[:2])
"""
[EodDataQuoteExtended(symbol=MSFT, quote_datetime=1992-01-01 00:00:00, open=2.319, high=2.319, low=2.319, close=2.319, volume=0, open_interest=0, previous=0.0, change=0.0, bid=0.0, ask=0.0, previous_close=0.0, next_open=0.0, modified=0001-01-01 00:00:00, name=Microsoft Corp, description=Microsoft Corp),
EodDataQuoteExtended(symbol=MSFT, quote_datetime=1992-01-02 00:00:00, open=2.308, high=2.392, low=2.282, close=2.377, volume=1551300, open_interest=0, previous=0.0, change=0.0, bid=0.0, ask=0.0, previous_close=0.0, next_open=0.0, modified=2008-12-27 12:51:50.413000, name=Microsoft Corp, description=Microsoft Corp)]
"""
```
14 changes: 0 additions & 14 deletions README.rst

This file was deleted.

11 changes: 11 additions & 0 deletions build.bat
@@ -0,0 +1,11 @@
@echo off
echo Building package...

rmdir /Q /S dist
rmdir /Q /S build
rmdir /Q /S eoddata_client.egg-info

python setup.py bdist_wheel

echo Publishing package...
twine upload --config-file .pypirc dist\*
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.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = eoddata-client
SOURCEDIR = .
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)
41 changes: 41 additions & 0 deletions docs/api.rst
@@ -0,0 +1,41 @@
Client API
==========

Http client
-----------

.. autoclass:: eoddata_client.EodDataHttpClient
:members:

Errors
------

.. autoclass:: eoddata_client.eoddata_client.Error
:members:

.. autoclass:: eoddata_client.eoddata_client.TestEnvironmentNotSet
:members:

.. autoclass:: eoddata_client.eoddata_client.InvalidTokenError
:members:

.. autoclass:: eoddata_client.eoddata_client.InvalidExchangeCodeError
:members:

.. autoclass:: eoddata_client.eoddata_client.InvalidSymbolCodeError
:members:

.. autoclass:: eoddata_client.eoddata_client.InvalidCredentialsError
:members:

.. autoclass:: eoddata_client.eoddata_client.NoDataAvailableError
:members:

.. autoclass:: eoddata_client.eoddata_client.EodDataInternalServerError
:members:

.. autoclass:: eoddata_client.eoddata_client.ReloginDepthReachedError
:members:

.. autoclass:: eoddata_client.eoddata_client.AccessLimitError
:members:
122 changes: 122 additions & 0 deletions docs/conf.py
@@ -0,0 +1,122 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import datetime

project_directory = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
# 'eoddata_client'
)

print(project_directory)
sys.path.insert(0, project_directory)

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
]

add_module_names = False

templates_path = ['_templates']

source_suffix = '.rst'

master_doc = 'index'

project = 'eoddata-client'
copyright = '%s, Aleksey' % datetime.date.today().year
author = 'Aleksey'

version = '0.3.3'

release = '0.3.3'

language = 'en'

exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

pygments_style = 'sphinx'

todo_include_todos = True

html_theme = 'alabaster'

html_theme_options = {
'show_powered_by': False,
'show_related': True
}

html_static_path = ['_static']

# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'eoddata-clientdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'eoddata-client.tex', 'eoddata-client Documentation',
'Aleksey', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'eoddata-client', 'eoddata-client Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'eoddata-client', 'eoddata-client Documentation',
author, 'eoddata-client', 'One line description of project.',
'Miscellaneous'),
]
18 changes: 18 additions & 0 deletions docs/index.rst
@@ -0,0 +1,18 @@
EodData Client
==============

.. toctree::
:maxdepth: 2
:caption: Table of Contents:

usage
api
stuff


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
36 changes: 36 additions & 0 deletions docs/make.bat
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=eoddata-client

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.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%
goto end

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

:end
popd
31 changes: 31 additions & 0 deletions docs/stuff.rst
@@ -0,0 +1,31 @@
Business entities and utils
===========================

Business entities
-----------------

.. autoclass:: eoddata_client.business_entities.EodDataExchange
:members:

.. autoclass:: eoddata_client.business_entities.EodDataQuoteCompact
:members:

.. autoclass:: eoddata_client.business_entities.EodDataQuoteExtended
:members:

.. autoclass:: eoddata_client.business_entities.EodDataSymbol
:members:

.. autoclass:: eoddata_client.business_entities.EodDataSymbolCompact
:members:

Utils
-----

.. autoclass:: eoddata_client.utils.ObjectProxy
:members:

.. autoclass:: eoddata_client.utils.RecursionDepthManager
:members:

.. automethod:: eoddata_client.utils.string_to_datetime

0 comments on commit 5794f94

Please sign in to comment.