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, ormode="original"for only the source file.- Parameters:
neuron_id (
int) – NeuroMorpho.Org numeric identifier (e.g.10047).dest (
str|Path|None) – Cache root.Noneresolves toDEFAULT_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) – IfTrue, re-download files that are already cached.client (
NeuroMorphoClient|None) – Reuse a pre-configured client (custom session, retries, etc.). A transient client is created whenNone.
- Returns:
Per-file outcomes plus the cached metadata path.
- Return type:
- Raises:
NeuroMorphoNotFoundError – If
neuron_iddoes not exist upstream.NeuroMorphoHTTPError – On non-recoverable HTTP errors.
See also
load_neuromorphoFetch and parse in one call.
NeuroMorphoClient.downloadLower-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')