Skip to main content

dxfeed package

This package provides access to dxFeed streaming data. The library is build as a thin wrapper over dxFeed C-API library. We use Cython in this project as it combines flexibility, reliability and usability in writing C extensions.

This package already contains basic C-API functions related to creating connections, subscriptions etc. Moreover default listeners (functions responsible for event processing) are ready to use. The user is also able to write his own custom listener in Cython

Installation

Requirements: python >3.6, pandas

pip3 install pandas

Install package via PyPI

pip3 install dxfeed

Basic usage

All the functions in C API have similar ones in Python with the same name. Not all arguments are supported by now, this work is in progress.

Import dxfeed library:

import dxfeed as dx

Create connection:

con = dx.dxf_create_connection(address='demo.dxfeed.com:7300')

Create one or several subscriptions of certain event types:

sub1 = dx.dxf_create_subscription(con, 'Trade')
sub2 = dx.dxf_create_subscription(con, 'Quote')

'Trade', 'Quote', 'Summary', 'Profile', 'Order', 'TimeAndSale', 'Candle', 'TradeETH', 'SpreadOrder', 'Greeks', 'TheoPrice', 'Underlying', 'Series', 'Configuration' event types are supported.

Attach listeners:

dx.dxf_attach_listener(sub1)
dx.dxf_attach_listener(sub2)

Add tickers you want to get data for:

dx.dxf_add_symbols(sub1, ['AAPL', 'MSFT'])
dx.dxf_add_symbols(sub2, ['AAPL', 'C'])

dxfeed has default listeners for each event type, but you are able to write your custom one. You can find how to do it at example/Custom listener example.ipynb.

Look at the data:

sub1.get_data()
sub2.get_data()

The data is stored in Subscription class. You can also turn dict to pandas DataFrame simply calling sub1.to_dataframe().

Detach the listener, if you want to stop recieving data:

dx.dxf_detach_listener(sub1)
dx.dxf_detach_listener(sub2)

Finally, close your connection:

dx.dxf_close_connection(con)

Release files for dxfeed 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dxfeed 0.2.0
File Size Uploaded
dxfeed-0.2.0.tar.gz 407.1 kB Details

Release files / dxfeed-0.2.0.tar.gz

Download URL dxfeed-0.2.0.tar.gz
Size 407.1 kB
Tags Source
SHA-256 checksum
How to use checksums
12ea98a9e5661af5640777cd18de9bf192eccfc3a25a0ef689cffda5fe909d18
BLAKE2b-256 checksum
How to use checksums
824a4840d60837c60b9cb7dfdb6c79866741b3ce2509fed1d2a2710577034ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.3 CPython/3.7.3 Windows/10

Release history Release notifications | RSS feed

0.5.2

7 release files

0.5.1

7 release files

0.5.0

7 release files

0.4.0

7 release files

0.3.0

7 release files

0.2.1

7 release files

This release

0.2.0 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page