py4cytoscape.filters.import_filters

import_filters(filename, base_url='http://127.0.0.1:1234/v1')[source]

Loads filters from a file in JSON format.

Adds filters to whatever filters already exist, and renames filters where names already exist. Also executes each filter.

Note

To load a filter file from cloud storage, use the file’s URL and the sandbox_url_to function to download the file to a sandbox, and then use import_filters to load it from there.

Parameters
  • filename (str) – Path and name of the filters file to load.

  • base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://localhost:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.

Returns

[]

Return type

list

Raises

requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error

Examples

>>> import_filters('test.json') # Fetches filters in file 'test.json'
[]
>>> import_filters('test') # Fetches filters in file 'test'
[]