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

Commit

Permalink
Merge pull request #131 from timkpaine/rules
Browse files Browse the repository at this point in the history
reformat docstrings, add stocktwits, add async SSE, add newsSSE/sentimentSSE/stock*SSE, re-add ws functions for now
  • Loading branch information
timkpaine authored Oct 24, 2020
2 parents b17ba07 + 78f41f1 commit a82e962
Show file tree
Hide file tree
Showing 48 changed files with 1,971 additions and 2,115 deletions.
138 changes: 108 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ All others:
-Prior trading day available after 4am ET Tue-Sat

Args:
symbol (string); Ticker to request
timeframe (string); Timeframe to request e.g. 1m
symbol (str); Ticker to request
timeframe (str); Timeframe to request e.g. 1m
date (datetime): date, if requesting intraday
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
token (str); Access token
version (str); API version
filter (str); filters: https://iexcloud.io/docs/api/#filter-results

Returns:
dict: result
Expand Down Expand Up @@ -79,8 +79,8 @@ IEX Cloud Client
Client has access to all methods provided as standalone, but in an authenticated way

Args:
api_token (string): api token (can pickup from IEX_TOKEN environment variable)
version (string): api version to use (defaults to v1)
api_token (str): api token (can pickup from IEX_TOKEN environment variable)
version (str): api version to use (defaults to v1)
set version to 'sandbox' to run against the IEX sandbox
api_limit (int): cache calls in this interval
File: ~/Programs/projects/iex/pyEX/pyEX/client.py
Expand Down Expand Up @@ -142,6 +142,19 @@ c.deleteRule("<ruleID>")
We also provide helper classes in python for constructing rules such that they abide by the rules schema (dictated in the `schema()` helper function)
## Data
`pyEX` provides 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 using `aiohttp` (to install the dependencies, `pip install pyEX[async]`).
DataFrame functions will have the suffix `DF`, and async functions will have the suffix `Async`.
SSE streaming data can either be used with callbacks:
`newsSSE('AAPL', on_data=my_function_todo_on_data)`
or via async generators (after installing `pyEX[async]`):
`async for data in newsSSE('AAPL'):`
### Full API
Please see the [readthedocs](https://pyEX.readthedocs.io) for a full API spec
Expand Down Expand Up @@ -348,38 +361,45 @@ Currently, the following methods are implemented:
- volumeByVenue
- volumeByVenueDF
### SSE Streaming
- topsSSE
- lastSSE
- deepSSE
- tradesSSE
### TOPS
- tops
- topsAsync
- topsDF
- last
- lastAsync
- lastDF
- deep
- deepAsync
- deepDF
- auction
- auctionAsync
- auctionDF
- bookDeep
- bookDeepAsync
- bookDeepDF
- officialPrice
- officialPriceAsync
- officialPriceDF
- opHaltStatus
- opHaltStatusAsync
- opHaltStatusDF
- securityEvent
- securityEventAsync
- securityEventDF
- ssrStatus
- ssrStatusAsync
- ssrStatusDF
- systemEvent
- systemEventAsync
- systemEventDF
- trades
- tradesAsync
- tradesDF
- tradeBreak
- tradeBreakAsync
- tradeBreakDF
- tradingStatus
- tradingStatusAsync
- tradingStatusDF
### Alternative
Expand All @@ -402,9 +422,6 @@ Currently, the following methods are implemented:
- historicalFX
- historicalFXDF
### FXSSE
- fxSSE
### Crypto
- cryptoBook
- cryptoBookDF
Expand All @@ -413,11 +430,6 @@ Currently, the following methods are implemented:
- cryptoPrice
- cryptoPriceDF
### CryptoSSE
- cryptoBookSSE
- cryptoEventsSSE
- cryptoQuotesSSE
### Rates
- thirtyYear
- twentyYear
Expand Down Expand Up @@ -461,8 +473,70 @@ Currently, the following methods are implemented:
- institutionalMoney
- retailMoney
### Premium
#### Wall Street Horizon
## Streaming Data
### SSE Streaming
- topsSSE
- topsSSEAsync
- lastSSE
- lastSSEASync
- deepSSE
- deepSSEAsync
- tradesSSE
- tradesSSEAsync
- auctionSSE
- auctionSSEAsync
- bookSSE
- bookSSEAsync
- opHaltStatusSSE
- opHaltStatusSSEAsync
- officialPriceSSE
- officialPriceSSEAsync
- securityEventSSE
- securityEventSSEAsync
- ssrStatusSSE
- ssrStatusSSEAsync
- systemEventSSE
- systemEventSSEAsync
- tradeBreaksSSE
- tradeBreaksSSEAsync
- tradingStatusSSE
- tradingStatusSSEAsync
### Stocks
- stocksUSNoUTPSSE
- stocksUSNoUTPSSEsync
- stocksUSSSE
- stocksUSSSEsync
- stocksUS1SecondSSE
- stocksUS1SecondSSEsync
- stocksUS5SecondSSE
- stocksUS5SecondSSEsync
- stocksUS1MinuteSSE
- stocksUS1MinuteSSEAsync
### News
- newsSSE
- newsSSEAsync
### Sentiment
- sentimentSSE
- sentimentSSEAsync
### FX
- fxSSE
- fxSSEAsync
### Crypto
- cryptoBookSSE
- cryptoBookSSEAsync
- cryptoEventsSSE
- cryptoEventsSSEAsync
- cryptoQuotesSSE
- cryptoQuotesSSEAsync
## Premium Data
### Wall Street Horizon
- analystDays
- analystDaysDF
- boardOfDirectorsMeeting
Expand Down Expand Up @@ -516,13 +590,13 @@ Currently, the following methods are implemented:
- workshops
- workshopsDF
#### Fraud Factors
### Fraud Factors
- nonTimelyFilings
- nonTimelyFilingsDF
- similarityIndex
- similarityIndexDF
#### Extract Alpha
### Extract Alpha
- cam1
- cam1DF
- esgCFPBComplaints
Expand Down Expand Up @@ -550,11 +624,11 @@ Currently, the following methods are implemented:
- tacticalModel1
- tacticalModel1DF
#### Precision Alpha
### Precision Alpha
- precisionAlphaPriceDynamics
- precisionAlphaPriceDynamicsDF
#### BRAIN Company
### BRAIN Company
- brain30DaySentiment
- brain30DaySentimentDF
- brain7DaySentiment
Expand All @@ -578,19 +652,23 @@ Currently, the following methods are implemented:
- brainLanguageMetricsOnCompanyFilingsDifference
- brainLanguageMetricsOnCompanyFilingsDifferenceDF
#### Kavout
### Kavout
- kScore
- kScoreDF
#### Audit Analytics
### Audit Analytics
- accountingQualityAndRiskMatrix
- accountingQualityAndRiskMatrixDF
- directorAndOfficerChanges
- directorAndOfficerChangesDF
#### ValuEngine
### ValuEngine
- valuEngineStockResearchReport
### StockTwits Sentiment
- socialSentiment
- socialSentimentDF
## Attribution
Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ All others:
-Prior trading day available after 4am ET Tue-Sat

Args:
symbol (string); Ticker to request
timeframe (string); Timeframe to request e.g. 1m
symbol (str); Ticker to request
timeframe (str); Timeframe to request e.g. 1m
date (datetime): date, if requesting intraday
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
token (str); Access token
version (str); API version
filter (str); filters: https://iexcloud.io/docs/api/#filter-results

Returns:
dict: result
Expand Down Expand Up @@ -79,8 +79,8 @@ IEX Cloud Client
Client has access to all methods provided as standalone, but in an authenticated way

Args:
api_token (string): api token (can pickup from IEX_TOKEN environment variable)
version (string): api version to use (defaults to v1)
api_token (str): api token (can pickup from IEX_TOKEN environment variable)
version (str): api version to use (defaults to v1)
set version to 'sandbox' to run against the IEX sandbox
api_limit (int): cache calls in this interval
File: ~/Programs/projects/iex/pyEX/pyEX/client.py
Expand Down
16 changes: 8 additions & 8 deletions examples/all.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3170,10 +3170,10 @@
"https://iexcloud.io/docs/api/#collections\n",
"\n",
"Args:\n",
" tag (string); Sector, Tag, or List\n",
" collectionName (string); Associated name for tag\n",
" token (string); Access token\n",
" version (string); API version\n",
" tag (str); Sector, Tag, or List\n",
" collectionName (str); Associated name for tag\n",
" token (str); Access token\n",
" version (str); API version\n",
"\n",
"Returns:\n",
" dict: result\n",
Expand Down Expand Up @@ -3215,10 +3215,10 @@
"https://iexcloud.io/docs/api/#collections\n",
"\n",
"Args:\n",
" tag (string); Sector, Tag, or List\n",
" collectionName (string); Associated name for tag\n",
" token (string); Access token\n",
" version (string); API version\n",
" tag (str); Sector, Tag, or List\n",
" collectionName (str); Associated name for tag\n",
" token (str); Access token\n",
" version (str); API version\n",
"\n",
"Returns:\n",
" DataFrame: result\n",
Expand Down
47 changes: 38 additions & 9 deletions pyEX/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,45 @@
from .economic import EconomicPoints # noqa: F401
from .fx import latestFX, latestFXDF, convertFX, convertFXDF, historicalFX, historicalFXDF # noqa: F401
from .markets import markets, marketsDF # noqa: F401
from .marketdata.cryptocurrency import cryptoBookSSE, cryptoEventsSSE, cryptoQuotesSSE # noqa: F401
from .marketdata.cryptocurrency import (cryptoBookSSE, cryptoBookSSEAsync, # noqa: F401
cryptoEventsSSE, cryptoEventsSSEAsync, # noqa: F401
cryptoQuotesSSE, cryptoQuotesSSEAsync) # noqa: F401
from .marketdata.fx import fxSSE # noqa: F401
from .marketdata.sse import topsSSE, lastSSE, deepSSE, tradesSSE # noqa: F401
from .marketdata.http import (tops, topsDF, last, lastDF, deep, deepDF, # noqa: F401
trades, tradesDF, auction, auctionDF, # noqa: F401
book as deepBook, bookDF as deepBookDF, # noqa: F401
opHaltStatus, opHaltStatusDF, officialPrice, officialPriceDF, # noqa: F401
securityEvent, securityEventDF, ssrStatus, ssrStatusDF, # noqa: F401
systemEvent, systemEventDF, tradeBreak, tradeBreakDF, # noqa: F401
tradingStatus, tradingStatusDF, hist, histDF) # noqa: F401
from .marketdata.news import newsSSE, newsSSEAsync # noqa: F401
from .marketdata.sentiment import sentimentSSE, sentimentSSEAsync # noqa: F401
from .marketdata.sse import (topsSSE, topsSSEAsync, # noqa: F401
lastSSE, lastSSEASync, # noqa: F401
deepSSE, deepSSEAsync, # noqa: F401
tradesSSE, tradesSSEAsync, # noqa: F401
auctionSSE, auctionSSEAsync, # noqa: F401
bookSSE, bookSSEAsync, # noqa: F401
opHaltStatusSSE, opHaltStatusSSEAsync, # noqa: F401
officialPriceSSE, officialPriceSSEAsync, # noqa: F401
securityEventSSE, securityEventSSEAsync, # noqa: F401
ssrStatusSSE, ssrStatusSSEAsync, # noqa: F401
systemEventSSE, systemEventSSEAsync, # noqa: F401
tradeBreaksSSE, tradeBreaksSSEAsync, # noqa: F401
tradingStatusSSE, tradingStatusSSEAsync) # noqa: F401
from .marketdata.stock import (stocksUSNoUTPSSE, stocksUSNoUTPSSEAsync, # noqa: F401
stocksUSSSE, stocksUSSSEAsync, # noqa: F401
stocksUS1SecondSSE, stocksUS1SecondSSEAsync, # noqa: F401
stocksUS5SecondSSE, stocksUS5SecondSSEAsync, # noqa: F401
stocksUS1MinuteSSE, stocksUS1MinuteSSEAsync) # noqa: F401
from .marketdata.http import (tops, topsAsync, topsDF, # noqa: F401
last, lastAsync, lastDF, # noqa: F401
deep, deepAsync, deepDF, # noqa: F401
hist, histAsync, histDF, # noqa: F401
trades, tradesAsync, tradesDF, # noqa: F401
auction, auctionAsync, auctionDF, # noqa: F401
book as deepBook, bookAsync as deepBookAsync, bookDF as deepBookDF, # noqa: F401
opHaltStatus, opHaltStatusAsync, opHaltStatusDF, # noqa: F401
officialPrice, officialPriceAsync, officialPriceDF, # noqa: F401
securityEvent, securityEventAsync, securityEventDF, # noqa: F401
ssrStatus, ssrStatusAsync, ssrStatusDF, # noqa: F401
systemEvent, systemEventAsync, systemEventDF, # noqa: F401
tradeBreak, tradeBreakAsync, tradeBreakDF, # noqa: F401
tradingStatus, tradingStatusAsync, tradingStatusDF) # noqa: F401
from .marketdata.ws import * # noqa: F401,F403
from .points import points, pointsDF # noqa: F401
from .rates import RatesPoints # noqa: F401
from .refdata import (symbols, iexSymbols, mutualFundSymbols, otcSymbols, internationalSymbols, fxSymbols, optionsSymbols, # noqa: F401
Expand Down
Loading

0 comments on commit a82e962

Please sign in to comment.