menu
Data

Persistence

DataGrids can be persisted to our APIs via our DataGrids service. This allows users to create a DataGrid and access it at a later time. Users can also share DataGrids with others so they can access your DataGrids without needing the code that created the DataGrid. This allows you to easily collaborate with your team to create grids. Persisting your DataGrids is also a necessary step to visualize DataGrids on our Marquee Markets platform.

Persist Your DataGrid

If you already have a DataGrid created in GS Quant, you can create, update, and share the grid.

Below are the methods used for persisting DataGrids:

MethodDescription
createCreates a new DataGrid whether or not the DataGrid has previously been persisted. Also useful for copying an existing datagrid to start a new one.
saveCreates or updates the DataGrid if it already exists. If you already have this DataGrid in a workspace the changes will be available on page refresh.
deleteDeletes the DataGrid if it has been persisted.

More can be found about these functions below with examples.

Create a Persisted DataGrid

The create method on a DataGrid will create a new DataGrid. The function returns the unique identifier of the newly created DataGrid. The DataGrid can from now on be referenced from this id.

datagrid_id = datagrid.create()
print(datagrid_id)

Output:

DGAMPVEIQVPFKW4S2Q

Update a Persisted DataGrid

You may not want to always want to create a new DataGrid everytime you wish to update a grid. In this case, users should use the save method. This also allows you to improve and add functionaltiy to your DataGrid over time.

datagrid_id = datagrid.save()
print(datagrid_id)

Output:

DGAMPVEIQVPFKW4S2Q

The create method will update the DataGrid if it has already been created and persisted. If the grid has not been persisted before, it will be created automatically. Users can see if a datagrid has already been persisted if it has an id. Users can check if the grid has an id by doing:

datagrid_id = datagrid.get_id()

If the DataGrid id is not None, then the DataGrid has already been persisted.

Share a Persisted DataGrid

Sharing a DataGrid can be done by editting the entitlements of a DataGrid.

This can be accomplished at the instantiation of the DataGrid object or updated anytime afterwards. Here's an example of both cases (we assume you have a rows and columns variables, see the overview to learn how to create these):

from gs_quant.api.gs.users import GsUsersApi

my_guid = GsUsersApi.get_my_guid()

entitlements = {
  'view': [my_guid],
  'edit': [my_guid],
  'admin': [my_guid]
}

datagrid = DataGrid('My DataGrid', rows=rows, columns=columns, entitlements=entitlements)
datagrid.save() # Persist/Create your datagrid with only you having access

# Add your friends to the view entitlements
emails = ['your@email.com', 'friends@email.com', 'emails@email.com', 'here@email.com']
my_friends_guids = GsUsersApi.get_guids_from_ids(GsUsersApi.get_user_ids_by_email(emails))
datagrid.entitlements['view'].extend(my_friends_guids)
datagrid.save() # Update your datagrid with your friends whom now have view access
info

Note

By default, every DataGrid you create is just entitled to yourself for each entitlement type unless you update or pass in entitlements.

Entitlements

Let us break down what each of these entitlements entail.

Entitlement TypeDescription
viewEntitled users can access the DataGrid.
editEntitled users can edit everything on the DataGrid except entitlements.
adminEntitled users can edit everything on the DataGrid including entitlements.

Delete a Persisted DataGrid

In some cases, users may want to delete a persisted DataGrid. This can be done by:

datagrid_id = datagrid.delete()

The delete method will remove the DataGrid from our APIs, hence all users who had access also cannot access it. Be careful when deleting DataGrids if others are using them!

Get Your Persisted DataGrids

Utilizing the GsDataGridApi class, users can get their all the DataGrids that they are entitled to view.

Get Many DataGrids

from gs_quant.api.gs.datagrid import GsDataGridApi

datagrids = GsDataGridApi.get_datagrids()
datagrid = datagrid[0]

# Then you can calculate your grids
datagrid.initialze(), datagrid.poll()
datagrid.to_frame()

By default, the method gets the first 10 DataGrids ordered by recently updated grids, but this limit can be increased by passing the limit argument. Users can also get just the DataGrids that they have created.

Get Your Own DataGrids

Users can get just the DataGrids they have created.

from gs_quant.api.gs.datagrid import GsDataGridApi

datagrids = GsDataGridApi.get_my_datagrids()

Get a Specific DataGrid

Users can get a single DataGrid by using the DataGrid id of the grid you want.

from gs_quant.api.gs.datagrid import GsDataGridApi

datagrid = GsDataGridApi.get_datagrid('DGAMPVEIQVPFKW4S2Q')

help

Questions?

Please contact us at gs-marquee-markets@gs.com with any questions or feedback.


Related Content


Certain solutions and Institutional Services described herein are provided via our Marquee platform. The Marquee platform is for institutional and professional clients only. This site is for informational purposes only and does not constitute an offer to provide the Marquee platform services described, nor an offer to sell, or the solicitation of an offer to buy, any security. Some of the services and products described herein may not be available in certain jurisdictions or to certain types of clients. Please contact your Goldman Sachs sales representative with any questions. Any data or market information presented on the site is solely for illustrative purposes. There is no representation that any transaction can or could have been effected on such terms or at such prices. Please see https://www.goldmansachs.com/disclaimer/sec-div-disclaimers-for-electronic-comms.html for additional information.
Transaction Banking services are offered by Goldman Sachs Bank USA (“GS Bank”). GS Bank is a New York State chartered bank, a member of the Federal Reserve System and a Member FDIC.
GS DAP™ is owned and operated by Goldman Sachs. This site is for informational purposes only and does not constitute an offer to provide, or the solicitation of an offer to provide access to or use of GS DAP™. Any subsequent commitment by Goldman Sachs to provide access to and / or use of GS DAP™ would be subject to various conditions, including, amongst others, (i) satisfactory determination and legal review of the structure of any potential product or activity, (ii) receipt of all internal and external approvals (including potentially regulatory approvals); (iii) execution of any relevant documentation in a form satisfactory to Goldman Sachs; and (iv) completion of any relevant system / technology / platform build or adaptation required or desired to support the structure of any potential product or activity.
Mosaic is a service mark of Goldman Sachs & Co. LLC. This service is made available in the United States by Goldman Sachs & Co. LLC and outside of the United States by Goldman Sachs International, or its local affiliates in accordance with applicable law and regulations. Goldman Sachs International and Goldman Sachs & Co. LLC are the distributors of the Goldman Sachs Funds. Depending upon the jurisdiction in which you are located, transactions in non-Goldman Sachs money market funds are affected by either Goldman Sachs & Co. LLC, a member of FINRA, SIPC and NYSE, or Goldman Sachs International. For additional information contact your Goldman Sachs representative. Goldman Sachs & Co. LLC, Goldman Sachs International, Goldman Sachs Liquidity Solutions, Goldman Sachs Asset Management, L.P., and the Goldman Sachs funds available through Goldman Sachs Liquidity Solutions and other affiliated entities, are under the common control of the Goldman Sachs Group, Inc.
© 2024 Goldman Sachs. All rights reserved.