The goal of rwPtools
is to make it easy to access The Lab’s datasets
and get started with research using the python language.
The Lab is Robot Wealth’s portal for collaborative research.
It is organized around Research Pods, which contain data, ideas, research and peer-reviewed edges for a given market question.
For example:
- in the Equity Factor Research Pod we look at the question: "What factors predict the relative performance of stocks in the Russell 1000 index?"
- In the Global Risk Premia Research Pod we look at the question: “What is the most effective way to get paid for taking on global market risks?”
The Lab serves three purposes:
- It gets you hands-on with the research effort. As well as contributing, you’ll learn a ton in the process.
- It scales the research effort by enabling community contribution.
- It makes the fruits of that scaled research effort available to the entire Robot Wealth community.
The easiest way to install and load rwPtools
and its dependencies is
via pip
:
pip install git+https://github.com/RWLab/rwPtools
After installing and loading rwPtools
, the quickest way to set up a
session for working on a particular Research Pod is:
from rwptools.auth import authenticate
authenticate()
When you call the function you will be taken through an interactive authentication flow, simply pick the email address you've signed up to RobotWealth with
from rwptools.rwlab_gcs import list_pods
list_pods()
>> ["EquityFactors"]
This transfers price data from the data library to path
and returns it.
IMPORTANT: It overwrites any local object at path
with the
Research Pod prices file name.
Requires that you have authorised to the data library prior.
from rwptools.rwlab_gcs import get_prices_data_frame
prices = get_prices_data_frame('EquityFactors')
prices.head()
This transfers the essential data that you always need to path
(ohlc,
metadata), overwriting any existing local Pod objects.
Requires that you’ve already authorised to the relevant GCS bucket.
from rwptools.rwlab_gcs import get_pod_meta
get_pod_meta(pod = "EquityFactors")
{'bucket': 'equity_factors_research_pod',
'datasets': ['R1000_fundamentals_1d.feather',
'R1000_metadata.feather',
'R1000_ohlc_1d.feather'],
'essentials': 'R1000_ohlc_1d.feather',
'prices': 'R1000_ohlc_1d.feather'}
This outputs a dictionary of all the data objects you can transfer for a Pod.
from rwptools.rwlab_gcs import transfer_lab_object
transfer_lab_object(pod = "EquityFactors", gcs_object = "R1000_ohlc_1d.feather", path = ".")
This transfers a specifc object to path
, overwriting any existing
local instance of that object.
Requires that you’ve already authorised to the relevant data library