Contribute
Getting Started
Give Feedback
Note
Goldman Sachs employees should follow this guide instead.
Prerequisites
- GitHub account
- Python 3.6 or higher installed
- Any Python IDE. We use PyCharm
- Marquee API Credentials by registering an app (optional)
- GitHub SSH configured for your account
Configuring a Working Copy of GS Quant
You will need to have the project running locally:
-
Visit our GitHub Repo and press the "fork" button. By doing so, a copy of the project will be created in your own GitHub repository.
-
Clone the repository. Find the "Clone or Download" button and copy the SSH URL to clone the repository locally. e.g.:
git clone git@github.com:YOUR_GITHUB_USERNAME/gs-quant.git
-
Change into the project directory
cd gs-quant
-
Setup a new remote that points to the original project so you can receive any new changes and merge them to your local project. First, go to the GS Quant GitHub Repo and copy the SSH URL. Then add the remote upstream:
git remote add upstream
By now you will have two remotes for GS Quant.
origin
which points to the forked project in your GitHub account, you have read and write access to this project.upstream
which points to the main GS Quant project. You only have read access to the main project.
Running the Project
Now that you have a local version of the project, you can open it in your preferred Python IDE. Then, you should:
- Create a virtual environment
- Activate your environment
- Install the project in develop mode. Make sure you are at the root of the project and then:
pip install -e .[develop]
- Run some code:
from gs_quant.timeseries import volatility, generate_series
# calculate vol for a time series
series = generate_series(100)
vol = volatility(series, 22)
- (optional) Test API access by replacing
CLIENT_ID
andCLIENT_SECRET
with your own Marquee app ID and secret:
import datetime
from gs_quant.data import Dataset
from gs_quant.session import Environment, GsSession
with GsSession.get(Environment.PROD, < client_id >, < client_secret >, scopes=('read_product_data', 'run_analytics')):
weather = Dataset('WEATHER')
df = weather.get_data(datetime.date(2016, 1, 15), datetime.date(2016, 1, 16), city=['Boston', 'Austin'])
Contribute
Please follow the guidelines on how to contribute found at the root of the project in the CONTRIBUTING.MD file.
Was this page useful?
Give feedback to help us improve developer.gs.com and serve you better.