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:

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()



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 =



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 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) # Persist/Create your datagrid with only you having access

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


By default, every DataGrid you create is just entitled to yourself for each entitlement type unless you update or pass in 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 import GsDataGridApi

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

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

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 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 import GsDataGridApi

datagrid = GsDataGridApi.get_datagrid('DGAMPVEIQVPFKW4S2Q')



Please contact us at with any questions or feedback.

Related Content