{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "is_executing": false } }, "outputs": [], "source": [ "from datetime import date\n", "from gs_quant.datetime.relative_date import RelativeDate\n", "from gs_quant.session import GsSession, Environment" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false }, "pycharm": { "is_executing": false, "name": "#%%\n" } }, "outputs": [], "source": [ "# external users should substitute their client id and secret; please skip this step if using internal jupyterh\n", "GsSession.use(Environment.PROD, client_id=None, client_secret=None, scopes=('read_product_data',))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false }, "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "holiday_calendar = [date(2020, 12, 15)]\n", "my_date = RelativeDate('-1b', base_date=date(2020, 12, 16)).apply_rule(holiday_calendar=holiday_calendar)\n", "my_date" ] } ], "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" }, "pycharm": { "stem_cell": { "cell_type": "raw", "source": [], "metadata": { "collapsed": false } } } }, "nbformat": 4, "nbformat_minor": 4 }