All Projects → dxFeed → dxfeed-python-api

dxFeed / dxfeed-python-api

Licence: MPL-2.0 License
dxFeed Python API based on dxFeed C API

Programming Languages

cython
566 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dxfeed-python-api

Tardis Node
Convenient access to tick-level real-time and historical cryptocurrency market data via Node.js
Stars: ✭ 126 (+687.5%)
Mutual labels:  real-time, market-data
robinhood.tools
📈🤑💰 Advanced trading tools and resources for Robinhood Web.
Stars: ✭ 27 (+68.75%)
Mutual labels:  real-time, market-data
intrinio-realtime-python-sdk
Intrinio Python SDK for Real-Time Stock Prices
Stars: ✭ 79 (+393.75%)
Mutual labels:  real-time, market-data
Iex Api
The IEX API provides any individual or academic, public or private institution looking to develop applications that require stock market data to access near real-time quote and trade data for all stocks trading on IEX.
Stars: ✭ 683 (+4168.75%)
Mutual labels:  real-time, market-data
Tosdatabridge
A collection of resources for pulling real-time streaming data off of TDAmeritrade's ThinkOrSwim(TOS) platform; providing C, C++, Java and Python interfaces.
Stars: ✭ 229 (+1331.25%)
Mutual labels:  real-time, market-data
pyrfa
Open sourced Python API for Refinitiv (Thomson Reuters) Enterprise Platform.
Stars: ✭ 49 (+206.25%)
Mutual labels:  real-time, market-data
databento-python
Official Python client library for Databento
Stars: ✭ 16 (+0%)
Mutual labels:  real-time, market-data
TorrentsDuck
A multi users bittorrents client with a responsive web UI that quacks 🦆
Stars: ✭ 42 (+162.5%)
Mutual labels:  real-time
Restoring-Extremely-Dark-Images-In-Real-Time
The project is the official implementation of our CVPR 2021 paper, "Restoring Extremely Dark Images in Real Time"
Stars: ✭ 79 (+393.75%)
Mutual labels:  real-time
asana-webhooks-manager
Asana Webhooks Manager (AWM) is a free and open source management and event handling server, written in JavaScript (NodeJS, Angular) for Asana's webhooks API. Use AWM to manage webhooks subscriptions and accept event payloads from Asana in real-time. Want to create your own Asana Dashboard? Consider AWM as your starting point!
Stars: ✭ 23 (+43.75%)
Mutual labels:  real-time
transform-hub
Flexible and efficient data processing engine and an evolution of the popular Scramjet Framework based on node.js. Our Transform Hub was designed specifically for data processing and has its own unique algorithms included.
Stars: ✭ 38 (+137.5%)
Mutual labels:  real-time
lxgui
Portable, real time, modular and data-driven GUI C++ library.
Stars: ✭ 50 (+212.5%)
Mutual labels:  real-time
haskell-tic-tac-toe
A multiplayer web real-time implementation of the famous Tic Tac Toe game in Haskell.
Stars: ✭ 51 (+218.75%)
Mutual labels:  real-time
mute-structs
MUTE-structs is a Typescript library that provides an implementation of the LogootSplit CRDT algorithm.
Stars: ✭ 14 (-12.5%)
Mutual labels:  real-time
motis
Intermodal Mobility Information System
Stars: ✭ 45 (+181.25%)
Mutual labels:  real-time
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (+0%)
Mutual labels:  real-time
tiny-cuda-nn
Lightning fast & tiny C++/CUDA neural network framework
Stars: ✭ 908 (+5575%)
Mutual labels:  real-time
SiamFC-tf
A TensorFlow implementation of the SiamFC tracker, use with your own camera and video, or integrate to your own project 实时物体追踪,封装API,可整合到自己的项目中
Stars: ✭ 22 (+37.5%)
Mutual labels:  real-time
Real-Time-Abnormal-Events-Detection-and-Tracking-in-Surveillance-System
The main abnormal behaviors that this project can detect are: Violence, covering camera, Choking, lying down, Running, Motion in restricted areas. It provides much flexibility by allowing users to choose the abnormal behaviors they want to be detected and keeps track of every abnormal event to be reviewed. We used three methods to detect abnorma…
Stars: ✭ 35 (+118.75%)
Mutual labels:  real-time
playhouse
A platform for real-time multiplayer trivia games 🎮
Stars: ✭ 20 (+25%)
Mutual labels:  real-time

dxfeed package

PyPI Documentation Status PyPI - Python Version PyPI - Wheel PyPI - License Test workflow

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.

The design of the dxfeed package allows users to write any logic related to events in python as well as extending lower level Cython functionality. Moreover, one may start working with the API using the default values like function arguments or a default event handler.

Documentation: dxfeed.readthedocs.io

Package distribution: pypi.org/project/dxfeed

Installation

Requirements: python >= 3.6

Install package via PyPI:

pip3 install dxfeed

Installation from sources

To install dxfeed from source you need Poetry. It provides a custom installer. This is the recommended way of installing poetry according to documentation

For macOS / Linux / Windows (with bash):

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

In the project root directory (same one where you found this file after cloning the git repo), execute:

poetry install 

By default package is installed in development mode. To rebuild C extensions, after editing .pyx files:

poetry run task build_inplace  # build c extensions

Basic usage

Following steps should be performed:

  • Import
  • Create Endpoint
  • Create Subscription
  • Attach event handler
  • Add tickers
  • Finally close subscription and connection

Import package

import dxfeed as dx
from datetime import datetime  # for timed subscription

Configure and create connection with Endpoint class

Create instance of Endpoint class which will connect provided address.

endpoint = dx.Endpoint('demo.dxfeed.com:7300')

Endpoint instance contains information about the connection, e.g. connection address or status

print(f'Connected address: {endpoint.address}')
print(f'Connection status: {endpoint.connection_status}')
Connected address: demo.dxfeed.com:7300
Connection status: Connected and authorized

Configure and create subscription

You should specify event type. For timed subscription (conflated stream) you should also provide time to start subscription from.

trade_sub = endpoint.create_subscription('Trade')

Attach default or custom event handler - class that process incoming events. For details about custom event handler look into CustomHandlerExample.ipynb jupyter notebook in exapmles folder of this repository.

trade_handler = dx.DefaultHandler()
trade_sub = trade_sub.set_event_handler(trade_handler)

Add tikers you want to receive events for

trade_sub = trade_sub.add_symbols(['C', 'AAPL'])

For timed subscription you may provide either datetime object or string. String might be incomplete, in this case you will get warning with how your provided date parsed automatically.

tns_sub = endpoint.create_subscription('TimeAndSale', date_time=datetime.now()) \
                  .add_symbols(['AMZN'])
candle_sub = endpoint.create_subscription('Candle', date_time='2020-04-16 13:05')
candle_sub = candle_sub.add_symbols(['AAPL', 'MSFT'])

We didn't provide subscriptions with event handlers. In such a case DefaultHandler is initiated automatically. One may get it with get_event_handler method.

tns_handler = tns_sub.get_event_handler()
candle_handler = candle_sub.get_event_handler()

Subscription instance properties

print(f'Subscription event type: {tns_sub.event_type}')
print(f'Subscription symbols: {candle_sub.symbols}')
Subscription event type: TimeAndSale
Subscription symbols: ['AAPL', 'MSFT']

Access data

In DefaultHandler the data is stored as deque. Its length may be configured, by default 100000 events.

candle_handler.get_list()

Close connection

endpoint.close_connection()
print(f'Connection status: {endpoint.connection_status}')
Connection status: Not connected

Transform data to pandas DataFrame

DefaultHandler has get_dataframe method, which allows you to get pandas.DataFrame object with events as rows.

trade_df = trade_handler.get_dataframe()
tns_df = tns_handler.get_dataframe()
candle_df = candle_handler.get_dataframe()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].