def add_share_key_to_url(plot_url):
 urlsplit = six.moves.urllib.parse.urlparse(plot_url)
 username = urlsplit.path.split('/')[1].split('~')[1]
 idlocal = urlsplit.path.split('/')[2]
 fid = '{}:{}'.format(username, idlocal)
 body = {'share_key_enabled': True, 'world_readable': False}
 response = v2.files.update(fid, body)
 return ((plot_url + '?share_key=') + response.json()['share_key'])

def add_share_key_to_url ( plot_url ) : urlsplit = six . moves . urllib . parse . urlparse ( plot_url ) username = urlsplit . path . split ( '/' ) [ 1 ] . split ( '~' ) [ 1 ] idlocal = urlsplit . path . split ( '/' ) [ 2 ] fid = '{}:{}' . format ( username , idlocal ) body = { 'share_key_enabled' : True , 'world_readable' : False } response = v2 . files . update ( fid , body ) return ( ( plot_url + '?share_key=' ) + response . json ( ) [ 'share_key' ] )
update plots url to include the secret key .