Giter Club home page Giter Club logo

tr_connect's Introduction

TR CONNECT

Thomson Reuters Python API provides a pythonic interface into several Thomson Reuters DBs.

  • Worldscope Fundamentals
  • Datastream Equity Pricing

Currently, Worldscope and Datastream are supported with I/B/E/S support coming soon.

Requirements

  • numpy 1.7
  • pandas 0.10+
  • iopro 1.4.2+
  • Valid TR Credentials:
  • User ID
  • Password
  • Driver Path
  • Server

Installation

The package is not yet designed for installation. Users can load the package by including the root level package directory path into their python scripts.

Usage

We recommend storing credentials in a json file (see basic_test.py and trkey.json for an example).

Example

    >>> from tr_connect import TR

    >>> #define or load credentials
    >>> creds = {"Uid": "XXXXXXXX", "Pwd": "XXXXXXXX", \
                "driver": "/usr/local/lib64/libsqlncli-11.0.so.1790.0", \
                "server": "XXX.XX.XXX.XXX,XXXX"}



    >>> #create tr  object
    >>> tr = TR(creds)

    >>> #single security-single measurement of 
    >>> ibm =  tr.query('IBM','ws.1751','Q')

    #Data Access
    >>>ibm.df #or ibm.data['ws.1751']
                       ws.1751
        1998-03-31  1031000000
        1998-06-30  1447000000
        1998-09-30  1489000000
        1998-12-31  2341000000
        1999-03-31  1465000000
        1999-06-30  2386000000

Queries

Queries to the Worldscope and Datastream DBs are prepended with ws. and ds. respectively.

#Datastream tr.query('security','ds.measure')

The Datastream DB stores daily open, high, low, close, etc. as such, frequency defaults to 'D'

Available measures from Datastream are (all measures are fully adjusted):

  • high
  • low
  • open
  • close
  • volume
  • bid
  • ask
  • vwap
  • the volume-weighted average price for the day
  • mosttrdprc
  • the most-traded price
  • consolvol
  • the consolidated volume
  • mosttrdvol
  • the most-traded volume
  • totalreturn
  • the total return of the security, including dividends, distributions, and spinoffs.
  • ohlc
  • a convenience measure which returns open, high, low, and close

Example:

tr.query('MSFT', 'ds.vwap') retrieves the time-series history of VWAP for Microsoft.

#Worldscope tr.query('security','ws.measure','frequency') The measures available for Worldscope are found in the wsitem_data.csv file distributed with the library. The measure is a four digit number corresponding to the description found in the wsitem_data.csv file.

Example:

tr.query('IBM', 'ws.1001', 'Q') retrieves the time-series history of Net Sales or Revenues for IBM, on a quarterly basis.

Searching for IDs

QA Direct maintains a list of internal symbols for securities: QAIDs. Often these overlap with public ticker names but not always. We have provided basic search functionality for finding the QAIDs by searching QA Direct's ID and Name Columns.

#search id for like BMW tr.find_id('BMW')

#search for Names like Bayerische tr.find_name('Bayerische')

In both instances a dictionary of arrays of QAID, Country, and Name are returned

Design

Class Names are CamelCase Function Names are lower_case_underscore

tr_connect's People

Contributors

fawce avatar jkrowas avatar quasiben avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.