Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
adding chartDF, upping version
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Nov 5, 2017
1 parent 835c5fa commit 10ba6c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pyEX
Python interface to IEX Api (https://iextrading.com/developer/docs/)

[![Version](https://img.shields.io/badge/version-0.0.1-lightgrey.svg)](https://img.shields.io/badge/version-0.0.1-lightgrey.svg)
[![Version](https://img.shields.io/badge/version-0.0.2-lightgrey.svg)](https://img.shields.io/badge/version-0.0.2-lightgrey.svg)
[![Build Status](https://travis-ci.org/timkpaine/pyEX.svg?branch=master)](https://travis-ci.org/timkpaine/pyEX)
[![Coverage](https://codecov.io/gh/timkpaine/pyEX/branch/master/graph/badge.svg)](https://codecov.io/gh/timkpaine/pyEX)
[![Waffle.io](https://badge.waffle.io/timkpaine/pyEX.png?label=ready&title=Ready)](https://waffle.io/timkpaine/pyEX?utm_source=badge)
Expand Down
8 changes: 6 additions & 2 deletions pyEX/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


_URL_PREFIX = 'https://api.iextrading.com/1.0/'
_TIMEFRAME_CHART = ['', '5y', '2y', '1y', 'ytd', '6m', '3m', '1m', '1d']
_TIMEFRAME_CHART = ['5y', '2y', '1y', 'ytd', '6m', '3m', '1m', '1d']
_TIMEFRAME_DIVSPLIT = ['5y', '2y', '1y', 'ytd', '6m', '3m', '1m']
_LIST_OPTIONS = ['mostactive', 'gainers', 'losers', 'iexvolume', 'iexpercent']

Expand Down Expand Up @@ -148,14 +148,18 @@ def marketNewsDF(count=10):
return pd.DataFrame(marketNews(count))


def chart(symbol, timeframe=''):
def chart(symbol, timeframe='1m'):
if timeframe not in _TIMEFRAME_CHART:
raise Exception('Range must be in %s' % str(_TIMEFRAME_CHART))
if timeframe:
return _getJson('stock/' + symbol + '/chart' + '/' + timeframe)
return _getJson('stock/' + symbol + '/chart')


def chartDF(symbol, timeframe='1m'):
return pd.DataFrame(chart(symbol, timeframe))


def logo(symbol):
return _getJson('stock/' + symbol + '/logo')

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

setup(
name='pyEX',
version='0.0.1',
version='0.0.2',
description='Rest API to IEX',
long_description=long_description,
url='https://github.com/timkpaine/pyEX',
download_url='https://github.com/timkpaine/pyEX/archive/v0.0.1.tar.gz',
download_url='https://github.com/timkpaine/pyEX/archive/v0.0.2.tar.gz',
author='Tim Paine',
author_email='[email protected]',
license='LGPL',
Expand Down

0 comments on commit 10ba6c6

Please sign in to comment.