Package: pyEX
Python interface toIEX CloudReferralPlease subscribe to IEX Cloud usingmy referral code.Getting StartedInstallInstall from pippip install pyEXof from sourcepython setup.py installExtensionspyEX[async]:asynciointegration for streaming APIspyEX[studies]: Technical indicators and other calculationsDemos + DocsDemo Notebook - IEX CloudStreaming Notebook - IEX CloudRead The Docs!OverviewpyEXsupports the IEX Cloud api through 2 interfaces. The first is a simple function call, passing in the api version and token as argumentsIn[1]:importpyEXasp

In[2]:p.chart?
Signature:p.chart(symbol,timeframe='1m',date=None,token='',version='',filter='')Docstring:
Historicalprice/volumedata,dailyandintraday

https://iexcloud.io/docs/api/#historical-prices
DataSchedule
1d:-9:30-4pmETMon-Frionregularmarkettradingdays-9:30-1pmETonearlyclosetradingdays
Allothers:-Priortradingdayavailableafter4amETTue-Sat

Args:symbol(str);Tickertorequesttimeframe(str);Timeframetorequeste.g.1mdate(datetime):date,ifrequestingintradaytoken(str);Accesstokenversion(str);APIversionfilter(str);filters:https://iexcloud.io/docs/api/#filter-results

Returns:dict:resultFor most calls, there is a convenience method that returns a dataframe as well:In[5]:[_for_indir(p)if_.endswith('DF')]Out[5]:['advancedStatsDF','auctionDF','balanceSheetDF','batchDF','bookDF','bulkBatchDF','bulkMinuteBarsDF','calendarDF',
...Since the token rarely changes, we have aClientobject for convenience:In[6]:p.Client?
Initsignature:p.Client(api_token=None,version='v1',api_limit=5)Docstring:
IEXCloudClient

Clienthasaccesstoallmethodsprovidedasstandalone,butinanauthenticatedway

Args:api_token(str):apitoken(canpickupfromIEX_TOKENenvironmentvariable)version(str):apiversiontouse(defaultstov1)setversionto'sandbox'torunagainsttheIEXsandboxapi_limit(int):cachecallsinthisinterval
File:~/Programs/projects/iex/pyEX/pyEX/client.py
Type:typeSubclasses:The client will automatically pick up the API key from the environment variableIEX_TOKEN, or it can be passed as an argument. To use the IEX Cloud test environment, simple setversion='sandbox'.In[8]:c=p.Client(version='sandbox')In[9]:c.chartDF('AAPL').head()Out[9]:openclosehighlowvolumeuOpenuCloseuHighuLowuVolumechangechangePercentlabelchangeOverTime
date2019-11-27271.31274.04277.09268.7516994433267.69271.99271.82266.32168117470.000.0000Nov270.0000002019-11-29271.30272.19280.00279.2012135259270.90275.02270.00267.1011927464-0.60-0.2255Nov29-0.0022322019-12-02279.96265.23276.41267.9323831255279.97266.80281.32269.2924607845-3.20-1.1646Dec2-0.0138202019-12-03261.54271.05259.96262.0930331487259.87271.34269.02260.7130518449-4.93-1.8450Dec3-0.0327452019-12-04272.81273.56271.26267.0617109161267.30262.82274.99270.83172305172.390.8955Dec4-0.023411Improvements over native API, other libraries, etcpyEX willtransparently cache requestsaccording to the refresh interval as defined on the IEX Cloud website (and in the docstrings), to avoid wasting credits. It can also cache to disk, or integrate with your own custom caching scheme.pyEX fully implements the streaming APIsOther enhancementspyEX-studies: pyEX integration with TA-Lib and other libraries, for technical analysis and other metrics on top of the IEX datapyEX-caching: persistent, queryable caching for pyEX function calls. Minimize your spend and maximize your performancepyEX-zipline:Ziplineintegration for IEX dataDemoRules EnginepyEXimplements methods for interacting with theRules Engine.rule={'conditions':[['changePercent','>',500],['latestPrice','>',100000]],'outputs':[{'frequency':60,'method':'email','to':'your_email@domain'}]}c.createRule(rule,'MyTestRule','AAPL','all')# returns {"id": <ruleID>, "weight": 2}c.rules()# list all rulesc.ruleInfo("<ruleID>")c.ruleOutput("<ruleID>")c.pauseRule("<ruleID>")c.resumeRule("<ruleID>")c.deleteRule("<ruleID>")We also provide helper classes in python for constructing rules such that they abide by the rules schema (dictated in theschema()helper function)Methodsschemalookupcreatepauseresumeeditrule (get info)rules (list all)outputDatapyEXprovides wrappers around both static and SSE streaming data. For most static data endpoints, we provide both JSON and DataFrame return functions. For market data endpoints, we provide async wrappers as well usingaiohttp(to install the dependencies,pip install pyEX[async]).DataFrame functions will have the suffixDF, and async functions will have the suffixAsync.SSE streaming data can either be used with callbacks:newsSSE('AAPL', on_data=my_function_todo_on_data)or via async generators (after installingpyEX[async]):async for data in newsSSE('AAPL'):Full APIPlease see thereadthedocsfor a full API spec. Implemented methods are provided inCATALOG.md.All methods share a common naming convention. If the API method is calledtechnicals, there will betechnicalsandtechnicalsDFmethods on the client. Additionally, most methods are provided in a scope, e.g.wtiis available asclient.wtiandclient.commodities.wti,analystDaysfrom Wall Street Horizon is available asclient.premium.analystDays, etc.DevelopmentSeeCONTRIBUTING.mdfor guidelines.LicenseThis software is licensed under the Apache 2.0 license. See theLICENSEandAUTHORSfiles for details.