from datetime import date
from gs_quant.markets.position_set import PositionSet
from gs_quant.session import Environment, GsSession
client = 'CLIENT ID'
secret = 'CLIENT SECRET'
GsSession.use(Environment.PROD, client_id=client, client_secret=secret, scopes=('read_product_data',))
# can alternatively specify 'quantity' instead of 'weight'
positions = [
{'identifier': 'AAPL UW', 'weight': 0.5},
{'identifier': 'MSFT UW', 'weight': 0.5}
]
position_set = PositionSet.from_dicts(positions)
position_set.resolve()