Skip to main content

Goldman Sachs Quant

Project description

GS Quant

Installation

pip install gs-quant

GS users: pip install gs-quant[internal] --user

Dependencies

Python 3.6 or 3.7

Example

import datetime
import numpy as np
import pandas as pd
from gs_quant.data import Dataset
from gs_quant.instrument import IRSwap
from gs_quant.common import Currency, PayReceive
import gs_quant.risk as risk
from gs_quant.session import Environment, GsSession
from gs_quant.timeseries import volatility

# N.b., GsSession.use(Environment.PROD, <client_id>, <client_secret>, scopes=('read_product_data','run_analytics')) will set the default session

with GsSession.get(Environment.PROD, <client_id>, <client_secret>, scopes=('read_product_data','run_analytics')):
    # get coverage for a dataset; run a query
    weather = Dataset('WEATHER')
    coverage = weather.get_coverage(weather) # GS-specific functionality
    df = weather.get_data(datetime.date(2016, 1, 15), datetime.date(2016, 1, 16), city=['Boston', 'Austin'])

    # calculate vol for a time series
    range = pd.date_range('1/1/2005', periods=3650, freq='D')
    series = pd.Series(np.random.rand(len(range)), index=range)  # randomly generated
    vol = volatility(series, 252)
    vol.plot()  # requires matplotlib

    # Non-GS users: the below functionality requires extra permissions
    # Please contact your sales coverage to request access

    # price an interest rates swap and compute its bucketed delta
    irs = IRSwap(PayReceive.Pay, "5y", Currency.USD, fixedRate=0.0275)
    pv = irs.price()
    ir_delta = irs.calc(risk.IRDelta)

Help

Write to our distribution list: developer@gs.com

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gs_quant-0.8.24-py3-none-any.whl (295.7 kB view details)

Uploaded Python 3

File details

Details for the file gs_quant-0.8.24-py3-none-any.whl.

File metadata

  • Download URL: gs_quant-0.8.24-py3-none-any.whl
  • Upload date:
  • Size: 295.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for gs_quant-0.8.24-py3-none-any.whl
Algorithm Hash digest
SHA256 5528fdf79f561add1302032f7ef26649b5b428df03701c147d740ac975c7cbec
MD5 e673714e516fbd1c42a5cde616346ef4
BLAKE2b-256 6cf3d1334e6311dccacb79ecefdd3f16245d67ad6974b84dfce6c787a202dcfd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page