Skip to main content

Lightweight standalone python CLI tool for downloading neuron morphologies from the NeuroMorpho archives.

Project description

neuromorphopy

License Documentation PyPI

Neuromorphopy logo

neuromorphopy is a lightweight, standalone Python CLI tool and library for efficiently searching and downloading neuron morphologies from the NeuroMorpho.org archives.

Features

  • Efficient Downloads: Uses asynchronous I/O (httpx + asyncio) for fast, concurrent downloads.
  • Flexible Querying: Search using simple YAML or JSON configuration files.
  • Metadata Management: Automatically cleans and saves neuron metadata to CSV.
  • Smart Validation: Validates search queries against the API schema before execution.
  • Robust: Handles legacy SSL requirements of the NeuroMorpho API automatically.

Installation

neuromorphopy requires Python 3.11 or later.

CLI Installation (Recommended)

The best way to install the tool for command-line use is with uv:

# Install the latest release
uv tool install neuromorphopy

# Or install the latest development version from GitHub
uv tool install git+https://github.com/kpeez/neuromorphopy.git

Development Installation

To work on the codebase or run from source:

  1. Clone the repository:

    git clone https://github.com/kpeez/neuromorphopy.git
    cd neuromorphopy
    
  2. Sync dependencies:

    uv sync
    # OR using just
    just install
    

Usage

1. Create a Query File

Define your search criteria in a query.yaml (or .json) file:

filters:
  species: ["mouse", "rat"]
  brain_region: ["neocortex"]
  cell_type: ["pyramidal"]
sort:
  field: "brain_region"
  order: "ascending"

2. Run Commands

Use the neuromorpho command to explore, preview, and download.

Explore Fields: See what fields and values are available for filtering.

# List all filterable fields
neuromorpho fields

# List valid values for a specific field
neuromorpho fields species

Preview Download: Check how many neurons match your query without downloading files.

neuromorpho preview query.yaml

Download Data: Download the SWC morphology files and metadata.

# Download to default ./neurons directory
neuromorpho download query.yaml

# Download to a specific directory with higher concurrency
neuromorpho download query.yaml --output-dir ./data --concurrent 50

# Group downloaded files by species and brain region
neuromorpho download query.yaml --group-by species,brain_region

Documentation

For more detailed usage, see our documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuromorphopy-0.3.3.tar.gz (766.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuromorphopy-0.3.3-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file neuromorphopy-0.3.3.tar.gz.

File metadata

  • Download URL: neuromorphopy-0.3.3.tar.gz
  • Upload date:
  • Size: 766.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for neuromorphopy-0.3.3.tar.gz
Algorithm Hash digest
SHA256 fc56af2e0f5d8e08586b00591cd9a7bd93fe4ec34cc6f89647b5960505b55805
MD5 ef863f67791d084b80629112c2a339a8
BLAKE2b-256 adaaf1523331c302e6811b1183bc37416847a6837270ce902d25faf01ecd04bb

See more details on using hashes here.

File details

Details for the file neuromorphopy-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: neuromorphopy-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for neuromorphopy-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b128945eecca126ce999d584b0e540eae9fb640f804df63a2acc97ba0ffff231
MD5 13edb64ed54fca44e5937d8c48096bf5
BLAKE2b-256 780cc706a6368b75ae2ae9d0a1711335635560ad594373c41d99872f403d668d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page