{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from gs_quant.markets.baskets import Basket\n", "from gs_quant.markets.indices_utils import FundamentalMetricPeriod, FundamentalMetricPeriodDirection\n", "from gs_quant.session import Environment, GsSession" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "client = 'CLIENT ID'\n", "secret = 'CLIENT SECRET'\n", "\n", "GsSession.use(Environment.PROD, client_id=client, client_secret=secret, scopes=('read_financial_data read_product_data read_content',))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "basket = Basket('GSMBXXXX') # substitute input with any identifier for a basket" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You may choose one of the following periods:\n", "\n", "* **1 year:** FundamentalMetricPeriod.*ONE_YEAR*\n", "* **2 years:** FundamentalMetricPeriod.*TWO_YEARS*\n", "* **3 years:** FundamentalMetricPeriod.*THREE_YEARS*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You may choose one of the following period directions:\n", "\n", "* **Forward:** FundamentalMetricPeriodDirection.*FORWARD*\n", "* **Trailing:** FundamentalMetricPeriodDirection.*TRAILING*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "basket.get_fundamentals(period=FundamentalMetricPeriod.TWO_YEARS, direction=FundamentalMetricPeriodDirection.TRAILING)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }