Thomson Reuters Feed API for Python

22 June 2015: New PyRFA 8.0.0 with Python 3 support.

PyRFA enables accessing Thomson Reuters Market Data system with Python language. It empowers Python application with crucial real-time market information from Thomson Reuters global data feeds and leverage on Python's vast mathematics and algorithmic libraries. Either you want to incorporate market data into quant modeling or embed it in a web site, it's never been easier.

Implementation

RFA Interfaces
PyRFA hides complicated layers of RFA classes, take care of redundant function calls in C, internally encode/decode messages and expose the simplest interfaces to a user and yet maintain strict concepts of RFA such as Session, Config Database, Event Queue.

Why Python?
Python programming language works well with C/C++ libraries like RFA. Its core libraries allow building extension in C++ and export interfaces to Python. With huge range of supported libraries, users find Python is a language of choice when building either a standalone application or web framework with scalability and robustness.

Threading Model
PyRFA extensively implements RFA threading models to ensure that a user can still select between latency or throughput constraints at the configuration level.

C/C++ Underneath
Our design pattern ensures PyRFA performance to be close to a native RFA C++ application.

License
PyRFA is free software and released under MIT License.

But Why Free?
It is made out from our own needs and we use it in-house extensively.

Latest Update
Read our changelog.

Features

Streaming or Snapshot
Supports market price, depth and order book subscription via OMM messaging.

Authentication
Supports native Thomson Reuters DAC auth including Username, Position and App ID.

Time-series
Ability to download and decode time-series data from TS1 service with selectable peroid.
See an example.

Data Publication
Full-cached non-interactive data publication capability for standard OMM level 1, 2, depth, order book, symbol list and service directory.

Build Your Own Historical Database

Only with PyRFA that allows you to build your own indexed time-series and store the data in TREP-RT platform for internal distribution leveraging on OMM custom domain.

Linux vs. Windows
PyRFA supports for both 32/64bit Windows and 64bit Linux. Requires Python 2.6 or later.

Python Data Type
PyRFA outputs decoded data into native Python data type such as tuple and dict allowing quick access of data records.

Other Goodies
Include dictionary download, symbol list, service direcotry listing, NIC binding, logging and more.
 
 

Example Script

import pyrfa
import sys

p = pyrfa.Pyrfa()
p.createConfigDb("./pyrfa.cfg")
p.acquireSession("Session1")
p.createOMMConsumer()
p.login()
p.directoryRequest()
p.dictionaryRequest()
p.marketPriceRequest("JPY=,EUR=")

end = False
while not end:
try:
updates = p.dispatchEventQueue(100)
except KeyboardInterrupt:
end = True
if updates:
print("")
for u in updates:
print(u['SERVICE'] + " - " + u['RIC'])
for k,v in u.items():
sys.stdout.write(k.rjust(15) + " ")
print(round(v,10) if type(v) is float else v)
print("")

p.marketPriceCloseAllRequest()

################ OUTPUT #####################

NIP - EUR=
ACT_TP_2 B
ACT_TP_3 B
SERVICE NIP
ACT_TP_1 B
MTYPE UPDATE
BID_NET_CH -0.0007
RIC EUR=
...


  Download from our public releases

Windows
pyrfa8.0.0.0 64bit
 (Python 3.4)
pyrfa8.0.0.0 64bit (Python 2.7)
pyrfa7.6.1.2 64bit | 32bit (Python 2.7)
pyrfa7.6.1.2 64bit | 32bit (Python 2.6)

Linux
pyrfa8.0.0.0 64bit (Python 3.4 + GCC 4.4)
pyrfa8.0.0.0 64bit (Python 2.7 + GCC 4.4)
pyrfa7.6.1.2 for RHEL 5 64bit (Python 2.4 + GCC 4.1.2)
pyrfa7.6.1.1 for RHEL 6.4 64bit (Python 2.6 + GCC 4.4)

Support
Visit API docs page
 or ask support on GitHub