danielecook / iex-api-python Goto Github PK
View Code? Open in Web Editor NEWA python wrapper for the IEX API
License: MIT License
A python wrapper for the IEX API
License: MIT License
Hi,
Stock.dividends() returns chart response. Is that expected behavior?
If not, need to change to call dividends API.
def dividends(self, range='1m'):
"""
Args:
range - what range of data to retrieve. The variable
'DIVIDEND_RANGES' has possible values in addition to a date.
"""
validate_range_set(range, RANGES)
return self._get(f"**dividends**/{range}")
Please remove print statements in the main branch. They are both noisy and do not follow the logger method, which is faster and prevents the system from hanging on logs.
Thanks!
Could you help with this issue?
c:\RH\myRH>python3 iex.py
Traceback (most recent call last):
File "iex.py", line 1, in
from iex import stock
File "c:\RH\myRH\iex.py", line 1, in
from iex import stock
ImportError: cannot import name 'stock' from 'iex' (c:\RH\myRH\iex.py)
After installing iex-api-python on fresh notebook at Google Colab, got error
!pip install iex-api-python
from iex import Stock
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-13-5a07ca1b682b> in <module>()
----> 1 from iex import Stock
/usr/local/lib/python3.6/dist-packages/iex/__init__.py in <module>()
2 from iex.stocks import Stock
3 from iex.batch import Batch
----> 4 from iex.market import market, Market
5 from iex.iex_stats import iex_stats, IexStats
6 from iex.iex_market import IexMarket
ImportError: cannot import name 'market'
---------------------------------------------------------------------------
Calling the peers method does not return a list of Stock objects; instead errors.
def peers(self, as_string=False):
if as_string:
return [x for x in self._get("peers")]
else:
return [stock(x) for x in self._get("peers")]
` NameError: name 'stock' is not defined
However, using the as_string=True parameter does successfully return the list which can then be looped through to get each peer's info.
I actually meant this print statement:
diff --git a/iex/stocks.py b/iex/stocks.py
index 8d031e0..03c9d8e 100644
--- a/iex/stocks.py
+++ b/iex/stocks.py
@@ -26,7 +26,8 @@ class Stock:
def _get(self, url, params={}):
request_url =f"{BASE_URL}/stock/{self.symbol}/{url}"
response = requests.get(request_url, params=params)
- print(response.url)
+ # Removed print for every URL we request
+ #print(response.url)
if response.status_code != 200:
raise Exception(f"{response.status_code}: {response.content.decode('utf-8')}")
result = response.json()
Getting Exception: 403: Forbidden
on the example:
Stock("F").price()
Did the api change?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.