braincell.io.fetch_neuromorpho

braincell.io.fetch_neuromorpho#

braincell.io.fetch_neuromorpho(neuron_id, dest=None, *, mode='standard', overwrite=False, client=None)[source]#

Download files for a NeuroMorpho.Org neuron without parsing.

The standardized CNG SWC is fetched by default. Pass mode="both" to additionally fetch the Source-Version file, or mode="original" for only the source file.

Parameters:
  • neuron_id (int) – NeuroMorpho.Org numeric identifier (e.g. 10047).

  • dest (str | Path | None) – Cache root. None resolves to DEFAULT_USER_CACHE_DIR (~/.cache/braincell/neuromorpho). The directory is created lazily on first write.

  • mode (Literal['standard', 'original', 'both']) – Which file(s) to download.

  • overwrite (bool) – If True, re-download files that are already cached.

  • client (NeuroMorphoClient | None) – Reuse a pre-configured client (custom session, retries, etc.). A transient client is created when None.

Returns:

Per-file outcomes plus the cached metadata path.

Return type:

NeuroMorphoDownloadRecord

Raises:

See also

load_neuromorpho

Fetch and parse in one call.

NeuroMorphoClient.download

Lower-level download with more control.

Examples

>>> from braincell.io import fetch_neuromorpho
>>> record = fetch_neuromorpho(10047)
>>> record.download_items[0].path
PosixPath('.../10047/TypeA-10.CNG.swc')