py4cytoscape.networks.get_network_name
-
get_network_name
(suid=None, base_url='http://127.0.0.1:1234/v1')[source] Get the name of a network.
- Parameters
suid (SUID or str or None) – SUID of the network; default is current network. If a name is provided, then it is validated and returned.
base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://127.0.0.1:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.
- Returns
network name
- Return type
str
- Raises
ValueError – if server response has no JSON
CyError – if network name or SUID doesn’t exist
requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error
Examples
>>> get_network_name() # get name of current network galFiltered.sif >>> get_network_name(22752) # get name of network having SUID galFiltered.sif >>> get_network_name('galFiltered.sif') # verify that current network is galFiltered.sif galFiltered.sif
Note
Together with get_network_suid, this function attempts to handle all of the multiple ways we support network referencing (e.g., title, SUID, ‘current’, and NULL). These functions are then used by all other functions that take a
network
argument.