Skip to content

Commit 110cb3c

Browse files
author
Aleksandr Salynskii
authored
Merge pull request #3 from dxFeed/EN-1335-correct-samples-and-doc
En 1335 correct samples and doc
2 parents 114c1b7 + 7e88e21 commit 110cb3c

File tree

7 files changed

+27
-28
lines changed

7 files changed

+27
-28
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ This library provides Python API to dxfeed via C API. The code is written in Pyt
44

55
## Installation
66

7-
**Requirements:** python >3.6, cython, pandas
7+
**Requirements:** python >3.6, pandas
88

99
```python
10-
pip3 install cython pandas
10+
pip3 install pandas
1111
```
1212

13-
Install package itself
13+
Install package via PyPI
1414

1515
```python
16-
pip3 install dxpyfeed-x.x.x.tar.gz
16+
pip3 install dxfeed
1717
```
1818

1919
## Basic usage
@@ -41,18 +41,18 @@ sub2 = dx.dxf_create_subscription(con, 'Quote')
4141
'Trade', 'Quote', 'Summary', 'Profile', 'Order', 'TimeAndSale', 'Candle', 'TradeETH', 'SpreadOrder',
4242
'Greeks', 'TheoPrice', 'Underlying', 'Series', 'Configuration' event types are supported.
4343

44-
**Add tickers you want to get data for**:
45-
```python
46-
dx.dxf_add_symbols(sub1, ['AAPL', 'MSFT'])
47-
dx.dxf_add_symbols(sub2, ['AAPL', 'C'])
48-
```
49-
5044
**Attach listeners**:
5145
```python
5246
dx.dxf_attach_listener(sub1)
5347
dx.dxf_attach_listener(sub2)
5448
```
5549

50+
**Add tickers you want to get data for**:
51+
```python
52+
dx.dxf_add_symbols(sub1, ['AAPL', 'MSFT'])
53+
dx.dxf_add_symbols(sub2, ['AAPL', 'C'])
54+
```
55+
5656
`dxfeed` has default listeners for each event type, but you are able to write
5757
your custom one. You can find how to do it at `example/Custom listener example.ipynb`.
5858

docs/basic_usage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ create. One connection may have several subscriptions.
3131
'Trade', 'Quote', 'Summary', 'Profile', 'Order', 'TimeAndSale', 'Candle', 'TradeETH', 'SpreadOrder',
3232
'Greeks', 'TheoPrice', 'Underlying', 'Series', 'Configuration' event types are supported.
3333

34-
Each subscription should be provided with tickers to get events for:
35-
36-
.. code-block:: python
37-
38-
dx.dxf_add_symbols(sub1, ['AAPL', 'MSFT'])
39-
dx.dxf_add_symbols(sub2, ['AAPL', 'C'])
40-
4134
Special function called listener should be attached to the subscription to start receiving
4235
events. There are default listeners already implemented in dxpyfeed, but you
4336
can write your own with cython: :ref:`custom_listener`. To attach
@@ -48,6 +41,13 @@ default listener just call `dxf_attach_listener`
4841
dx.dxf_attach_listener(sub1)
4942
dx.dxf_attach_listener(sub2)
5043
44+
Each subscription should be provided with tickers to get events for:
45+
46+
.. code-block:: python
47+
48+
dx.dxf_add_symbols(sub1, ['AAPL', 'MSFT'])
49+
dx.dxf_add_symbols(sub2, ['AAPL', 'C'])
50+
5151
The data can be extracted with `get_data()` method. It is stored as dict with list of columns and list
5252
of events. Note that `get_data` extracts the data and then clean the field. To look at data call this property:
5353

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pyproject = toml.load(Path(__file__).parents[1].joinpath('pyproject.toml'))
1010
# -- Path setup --------------------------------------------------------------
1111

12-
sys.path.append(Path(__file__).parents[1])
12+
sys.path.append(str(Path(__file__).parents[1]))
1313
# -- Project information -----------------------------------------------------
1414

1515
project = pyproject['tool']['poetry']['name']

docs/custom_listener.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,19 @@ You can either import extension built on previous step or install your extension
127127
128128
con = dx.dxf_create_connection()
129129
sub = dx.dxf_create_subscription(con, 'Trade')
130-
dx.dxf_add_symbols(sub, ['AAPL', 'MSFT'])
131130
132131
Attach custom listener, specifying the columns
133132

134133
.. code:: ipython3
135134
136135
dx.dxf_attach_custom_listener(sub, cust.tc, ['Symbol', 'Price'])
136+
dx.dxf_add_symbols(sub, ['AAPL', 'MSFT'])
137137
138138
After some time you will get the data.
139139

140140
.. code:: ipython3
141141
142-
sub.gat_data()
142+
sub.get_data()
143143
144144
.. code:: ipython3
145145

docs/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Installation
1010
1111
pip3 install pandas
1212
13-
The easiest way to install dxpyfeed is to use pip
13+
The easiest way to install dxfeed is to use pip
1414

1515
.. code-block:: bash
1616
17-
pip3 install dxpyfeed-x.x.x.tar.gz
17+
pip3 install dxfeed
1818
1919
.. warning::
2020
Package is not available on MacOS for now

examples/CustomListenerExample.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@
191191
"outputs": [],
192192
"source": [
193193
"con = dx.dxf_create_connection()\n",
194-
"sub = dx.dxf_create_subscription(con, 'Trade')\n",
195-
"dx.dxf_add_symbols(sub, ['AAPL', 'MSFT'])"
194+
"sub = dx.dxf_create_subscription(con, 'Trade')"
196195
]
197196
},
198197
{
@@ -208,7 +207,8 @@
208207
"metadata": {},
209208
"outputs": [],
210209
"source": [
211-
"dx.dxf_attach_custom_listener(sub, cust.tc, ['Symbol', 'Price'])"
210+
"dx.dxf_attach_custom_listener(sub, cust.tc, ['Symbol', 'Price'])\n",
211+
"dx.dxf_add_symbols(sub, ['AAPL', 'MSFT'])"
212212
]
213213
},
214214
{

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[tool.poetry]
22
name = "dxfeed"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "DXFeed Python API via C API"
5-
authors = ["Ivan Mishalkin <ivan.mishalkin@devexperts.com>",
6-
"DxCurrent Team <dxcurrent@devexperts.com>"]
5+
authors = ["Index Management Team <im@dxfeed.com>"]
76
build = "build.py"
87
license = "MPL-2.0"
98
readme = "README.md"

0 commit comments

Comments
 (0)