pymaid.CatmaidInstance.fetch

CatmaidInstance.fetch(url, post=None, files=None, on_error='raise', desc='Fetching', disable_pbar=False, leave_pbar=True, return_type='json')[source]

Fetch data from given URL(s).

Parameters
  • url (str, list of str) – URL or list of URLs to fetch data from.

  • post (None | dict | list of dict) – If provided, will send POST request. Must provide one dictionary for each url.

  • files (str, optional) – Files to be sent alongside POST request.

  • on_error ("raise" | "log" | "pass") – What to do if request returns an error code: raise an exception, log the error but continue or silently pass.

  • desc (str, optional) – Message for progress bar.

  • disable_pbar (bool, optional) – If True, won’t show progress bar.

  • leave_pbar (bool, optional) – If True, will not remove pbar after finishing.

  • return_type ("json" | "raw" | "request") –

    Set how to return data:

    json: return json parsed data (default)
    raw: return unparsed response content
    request: return request object