Skip to main content

Goldman Sachs Quant

Project description

GS Quant

Installation

pip install gs_quant

Dependencies

Python 3.6 or 3.7
Package dependencies can be installed by pip.

Example

import datetime
import numpy as np
import pandas as pd

from gs_quant.session import Environment, GsSession

# 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
	from gs_quant.api.dataset import Dataset
    weather = Dataset('WEATHER')
    coverage = weather.get_coverage()
    df = weather.get_data(datetime.date(2016, 1, 15), datetime.date(2016, 1, 16), city=['Boston', 'Austin'])

    # calculate vol for a time series
	from gs_quant.timeseries import realized_volatility
    range = pd.date_range('1/1/2005', periods=3650, freq='D')
    curve = pd.Series(np.random.rand(len(range)), index=range)  # randomly generated
    vol = realized_volatility(curve, 252)
    vol.plot()  # requires matplotlib
    
    # price an interest rates swap and compute its bucketed delta
	from gs_quant.api.instrument import IRSwap
	from gs_quant.api.common import Currency, PayReceive
	import gs_quant.api.risk as risk
    irs = IRSwap(PayReceive.Pay, "5y", Currency.USD, fixedRate=0.035)
    pv = irs.price()
    irDelta = irs.calc(risk.IRDelta)

Help

Questions? Comments? Write to data-services@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 Distribution

gs_quant-0.5.3.tar.gz (139.6 kB view details)

Uploaded Source

File details

Details for the file gs_quant-0.5.3.tar.gz.

File metadata

  • Download URL: gs_quant-0.5.3.tar.gz
  • Upload date:
  • Size: 139.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for gs_quant-0.5.3.tar.gz
Algorithm Hash digest
SHA256 6bd60561da9d6255cb56764e669f489fbf297f41d8eab8bee21b4caf0c8b5640
MD5 b8e48f3f73068b33fe5ffa9258d72a37
BLAKE2b-256 6d342ef9b15e2ee6095b479d04665dcb8dc9047f950768d075439f5280b681fa

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