{"id":21411,"library":"gs-quant","title":"GS Quant","description":"GS Quant is a Python toolkit for quantitative finance developed by Goldman Sachs. It provides analytics, risk models, and market data access used by the firm's risk management and trading platforms. The current version is 1.6.22, with monthly releases.","status":"active","version":"1.6.22","language":"python","source_language":"en","source_url":"https://github.com/goldmansachs/gs-quant","tags":["quantitative finance","risk models","Goldman Sachs","API"],"install":[{"cmd":"pip install gs-quant","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"Module name uses underscore, not hyphen","wrong":"from gsquant.api import GxQuantApi","symbol":"GxQuantApi","correct":"from gs_quant.api import GxQuantApi"},{"note":"Hyphen not allowed in import paths","wrong":"from gs-quant.risk import RiskModel","symbol":"RiskModel","correct":"from gs_quant.risk import RiskModel"},{"note":"","wrong":"","symbol":"Session","correct":"from gs_quant.session import Session"}],"quickstart":{"code":"from gs_quant.session import Session\nfrom gs_quant.api import GxQuantApi\nimport os\n\n# Authenticate with client id and secret\nSession.use(client_id=os.environ.get('GS_CLIENT_ID', ''),\n            client_secret=os.environ.get('GS_CLIENT_SECRET', ''))\n\n# Fetch risk model data\napi = GxQuantApi()\nmodel = api.get_risk_model('GSM2')\nprint(model.name)","lang":"python","description":"Initialize session with credentials, then fetch a risk model."},"warnings":[{"fix":"Update Python to >=3.9 and pip install gs-quant>=1.0","message":"GS Quant v1.0+ dropped support for Python 3.8 and below. Upgrade to Python 3.9+.","severity":"breaking","affected_versions":"<1.0"},{"fix":"Use 'from gs_quant.session import Session' instead of 'from gs_quant.session import GsSession'","message":"The GsSession class is deprecated in favor of Session in v1.5+.","severity":"deprecated","affected_versions":">=1.5"},{"fix":"Always use 'from gs_quant...' in your code.","message":"Imports must use underscores: 'gs_quant' not 'gs-quant'. The hyphen is only in the PyPI package name.","severity":"gotcha","affected_versions":"all"},{"fix":"Set environment variables before importing gs_quant, or use Session.use() with explicit credentials.","message":"API keys for production must be set via environment variables, not hardcoded. The library checks env vars GS_CLIENT_ID and GS_CLIENT_SECRET.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'import gs_quant' (with underscore).","cause":"Package installed as 'gs-quant' but imported with hyphen.","error":"ModuleNotFoundError: No module named 'gs_quant'"},{"fix":"Use 'from gs_quant.session import Session'.","cause":"GsSession was renamed to Session in version 1.5+.","error":"ImportError: cannot import name 'GsSession' from 'gs_quant.session'"},{"fix":"Set GS_CLIENT_ID and GS_CLIENT_SECRET environment variables, or pass them to Session.use().","cause":"Missing or invalid credentials. The environment variables GS_CLIENT_ID and GS_CLIENT_SECRET are not set or incorrect.","error":"gs_quant.exceptions.GsAuthenticationError: Authentication failed. Check your client ID and secret."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}