1
- .. pyEX documentation master file, created by
2
- sphinx-quickstart on Fri Jan 12 22:07:11 2018.
3
- You can adapt this file completely to your liking, but it should at least
4
- contain the root `toctree` directive.
5
-
6
1
pyEX
7
- ===================================
8
- Python interface to IEX Api (https://iextrading.com/developer/docs/)
9
-
10
-
11
- |build-status | |issues | |codecov | |bch | |pypiv | |pypil | |docs |
12
-
2
+ ====
13
3
14
4
.. toctree ::
15
5
:maxdepth: 2
@@ -18,40 +8,156 @@ Python interface to IEX Api (https://iextrading.com/developer/docs/)
18
8
installation
19
9
api
20
10
21
- .. WARNING :: For API documentation, see the API section on the left
11
+ Python interface to IEX Api (https://iextrading.com/developer/docs/)
12
+
13
+ |Build Status | |Coverage | |BCH compliance | |License | |PyPI | |Docs |
14
+
15
+ Referral
16
+ --------
17
+
18
+ Please subscribe to IEX Cloud using `my referral
19
+ code <https://iexcloud.io/s/6332a3c3> `__.
20
+
21
+ Getting Started
22
+ ===============
23
+
24
+ - `Demo Notebook - IEX
25
+ Cloud <https://github.com/timkpaine/pyEX/blob/master/examples/all.ipynb> `__
26
+ - `Streaming Notebook - IEX
27
+ Cloud <https://github.com/timkpaine/pyEX/blob/master/examples/sse.ipynb> `__
28
+ - `Read The Docs! <https://pyEX.readthedocs.io >`__
29
+
30
+ ``pyEX `` supports the IEX Cloud api through 2 interfaces. The first is a
31
+ simple function call, passing in the api version and token as arguments
32
+
33
+ .. code :: bash
34
+
35
+ In [1]: import pyEX as p
36
+
37
+ In [2]: p.chart?
38
+ Signature: p.chart(symbol, timeframe=' 1m' , date=None, token=' ' , version=' ' , filter=' ' )
39
+ Docstring:
40
+ Historical price/volume data, daily and intraday
41
+
42
+ https://iexcloud.io/docs/api/# historical-prices
43
+ Data Schedule
44
+ 1d: -9:30-4pm ET Mon-Fri on regular market trading days
45
+ -9:30-1pm ET on early close trading days
46
+ All others:
47
+ -Prior trading day available after 4am ET Tue-Sat
48
+
49
+ Args:
50
+ symbol (string); Ticker to request
51
+ timeframe (string); Timeframe to request e.g. 1m
52
+ date (datetime): date, if requesting intraday
53
+ token (string); Access token
54
+ version (string); API version
55
+ filter (string); filters: https://iexcloud.io/docs/api/# filter-results
56
+
57
+ Returns:
58
+ dict: result
59
+
60
+ For most calls, there is a convenience method that returns a dataframe
61
+ as well:
62
+
63
+ .. code:: bash
64
+
65
+ In [5]: [_ for _ in dir(p) if _.endswith(' DF' )]
66
+ Out[5]:
67
+ [' advancedStatsDF' ,
68
+ ' auctionDF' ,
69
+ ' balanceSheetDF' ,
70
+ ' batchDF' ,
71
+ ' bookDF' ,
72
+ ' bulkBatchDF' ,
73
+ ' bulkMinuteBarsDF' ,
74
+ ' calendarDF' ,
75
+ ...
76
+
77
+ Since the token rarely changes, we have a ` ` Client` ` object for
78
+ convenience:
79
+
80
+ .. code:: bash
81
+
82
+ In [6]: p.Client?
83
+ Init signature: p.Client(api_token=None, version=' v1' , api_limit=5)
84
+ Docstring:
85
+ IEX Cloud Client
86
+
87
+ Client has access to all methods provided as standalone, but in an authenticated way
88
+
89
+ Args:
90
+ api_token (string): api token (can pickup from IEX_TOKEN environment variable)
91
+ version (string): api version to use (defaults to v1)
92
+ set version to ' sandbox' to run against the IEX sandbox
93
+ api_limit (int): cache calls in this interval
94
+ File: ~ /Programs/projects/iex/pyEX/pyEX/client.py
95
+ Type: type
96
+ Subclasses:
97
+
98
+ The client will automatically pick up the API key from the environment
99
+ variable ` ` IEX_TOKEN` ` , or it can be passed as an argument. To use the
100
+ IEX Cloud test environment, simple set ` ` version= ' sandbox' ` ` .
101
+
102
+ .. code:: bash
103
+
104
+ In [8]: c = p.Client(version=' sandbox' )
105
+
106
+ In [9]: c.chartDF('AAPL').head ()
107
+ Out[9]:
108
+ open close high low volume uOpen uClose uHigh uLow uVolume change changePercent label changeOverTime
109
+ date
110
+ 2019-11-27 271.31 274.04 277.09 268.75 16994433 267.69 271.99 271.82 266.32 16811747 0.00 0.0000 Nov 27 0.000000
111
+ 2019-11-29 271.30 272.19 280.00 279.20 12135259 270.90 275.02 270.00 267.10 11927464 -0.60 -0.2255 Nov 29 -0.002232
112
+ 2019-12-02 279.96 265.23 276.41 267.93 23831255 279.97 266.80 281.32 269.29 24607845 -3.20 -1.1646 Dec 2 -0.013820
113
+ 2019-12-03 261.54 271.05 259.96 262.09 30331487 259.87 271.34 269.02 260.71 30518449 -4.93 -1.8450 Dec 3 -0.032745
114
+ 2019-12-04 272.81 273.56 271.26 267.06 17109161 267.30 262.82 274.99 270.83 17230517 2.39 0.8955 Dec 4 -0.023411
115
+
116
+ Improvements over native API, other libraries, etc
117
+ --------------------------------------------------
118
+
119
+ - pyEX will ** transparently cache requests** according to the refresh
120
+ interval as defined on the IEX Cloud website (and in the docstrings),
121
+ to avoid wasting credits. It can also cache to disk, or integrate
122
+ with your own custom caching scheme.
123
+ - pyEX fully implements the streaming APIs
22
124
125
+ Other enhancements
126
+ ------------------
23
127
24
- .. |build-status | image :: https://travis-ci.org/timkpaine/pyEX.svg?branch=master
25
- :alt: Build Status
26
- :scale: 100%
27
- :target: https://travis-ci.org/timkpaine/pyEX
128
+ - ` pyEX-studies < https://github.com/timkpaine/pyEX-studies> ` __: pyEX
129
+ integration with TA-Lib and other libraries, for technical analysis
130
+ and other metrics on top of the IEX data
131
+ - ` pyEX-caching < https://github.com/timkpaine/pyEX-caching> ` __:
132
+ persistent, queryable caching for pyEX function calls. Minimize your
133
+ spend and maximize your performance
134
+ - ` pyEX-zipline < https://github.com/timkpaine/pyEX-zipline> ` __:
135
+ ` Zipline < https://github.com/quantopian/zipline> ` __ integration for
136
+ IEX data
28
137
29
- .. |issues | image :: https://img.shields.io/github/issues/timkpaine/pyEX.svg
30
- :alt: Issues
31
- :scale: 100%
32
- :target: https://img.shields.io/github/issues/timkpaine/pyEX.svg
138
+ Demo
139
+ ----
33
140
34
- .. |codecov | image :: https://codecov.io/gh/timkpaine/pyEX/branch/master/graph/badge.svg
35
- :alt: Codecov
36
- :scale: 100%
37
- :target: https://codecov.io/gh/timkpaine/pyEX
141
+ | image6|
38
142
39
- .. |bch | image :: https://bettercodehub.com/edge/badge/timkpaine/pyEX?branch=master
40
- :alt: BCH
41
- :scale: 100%
42
- :target: https://bettercodehub.com/
143
+ Attribution
144
+ -----------
43
145
44
- .. |pypiv | image :: https://img.shields.io/pypi/v/pyEX.svg
45
- :alt: Version
46
- :scale: 100%
47
- :target: https://pypi.python.org/pypi/pyEX
146
+ - ` Powered by IEX Cloud < https://iexcloud.io> ` __
147
+ - Data provided for free by ` IEX < https://iextrading.com/developer> ` __.
148
+ - ` IEX terms of service < https://iextrading.com/api-exhibit-a> ` __
48
149
49
- .. |pypil | image :: https://img.shields.io/pypi/l/pyEX.svg
50
- :alt: License
51
- :scale: 100%
52
- :target: https://pypi.python.org/pypi/pyEX
150
+ .. | Build Status| image:: https://travis-ci.org/timkpaine/pyEX.svg? branch= master
151
+ :target: https://travis-ci.org/timkpaine/pyEX
152
+ .. | Coverage| image:: https://codecov.io/gh/timkpaine/pyEX/branch/master/graph/badge.svg
153
+ :target: https://codecov.io/gh/timkpaine/pyEX
154
+ .. | BCH compliance| image:: https://bettercodehub.com/edge/badge/timkpaine/pyEX? branch= master
155
+ :target: https://bettercodehub.com/
156
+ .. | License| image:: https://img.shields.io/github/license/timkpaine/pyEX.svg
157
+ :target: https://pypi.python.org/pypi/pyEX/
158
+ .. | PyPI| image:: https://img.shields.io/pypi/v/pyEX.svg
159
+ :target: https://pypi.python.org/pypi/pyEX/
160
+ .. | Docs| image:: https://readthedocs.org/projects/pyex/badge/? version= latest
161
+ :target: https://pyex.readthedocs.io/en/latest/? badge= latest
162
+ .. | image6| image:: https://raw.githubusercontent.com/timkpaine/pyEX/master/docs/img/example1.gif
53
163
54
- .. |docs | image :: https://readthedocs.org/projects/pyex/badge/?version=latest
55
- :target: https://pyex.readthedocs.io/en/latest/?badge=latest
56
- :alt: Docs
57
- :scale: 100%
0 commit comments