Skip to main content

NeuronBridge Python API

DOI

A Python API for the NeuronBridge neuron similarity search service.

Data Model Diagram

Installation

This library is available on PyPI, so you can install it like this:

pip install neuronbridge-python

Usage

The client will automatically select the latest version of the data and fetch it from S3. Here's a simple example of how to get an EM image by id:

from neuronbridge import client
client = client.Client()
em_image = client.get_em_image(636798093) 

See this notebook for complete usage examples.

Development Notes

To build this code you will need to install UV.

Create a new UV virtual environment and install the dependencies:

uv venv --python 3.11
source .venv/bin/activate
uv pip sync requirements-universal.txt
uv pip install -e .

Running data validation using Ray

You can run validation multithreaded on a single machine like this:

./neuronbridge/validate_ray.py --dashboard --cores 60

To run the validation script in a distributed manner on the Janelia cluster, you must first install ray-janelia in a sister directory to where this code base is cloned. Then run a script to bsub the Ray cluster:

./scripts/launch_validation.sh

Updating requirements

After updating the requirements.txt file, you can sync the requirements-universal.txt file like this:

uv pip compile requirements.txt --universal --output-file  requirements-universal.txt

Regenerate the JSON schemas:

python neuronbridge/generate_schemas.py

Run the unit tests:

pixi run test

Publishing a new release

  1. Update the version in setup.py
  2. Push all changes and tag a release in GitHub
  3. Build PyPI distribution:
pixi run pypi-build
  1. Upload to PyPI:
pixi run pypi-upload

Metadata

Release files for neuronbridge-python 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neuronbridge-python 3.3.0
File Size Uploaded
neuronbridge_python-3.3.0.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neuronbridge-python 3.3.0
File Interpreter ABI Platform
neuronbridge_python-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / neuronbridge_python-3.3.0.tar.gz

Download URL neuronbridge_python-3.3.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
97a1ccb32a5e29cdb64234694d6a311510630341e45a19d002fa48266624f892
BLAKE2b-256 checksum
How to use checksums
58614d2025ef7d4f9c0c41900e6008a904df67af53fc1036c773af710a933354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / neuronbridge_python-3.3.0-py3-none-any.whl

Download URL neuronbridge_python-3.3.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eecca87809c1c744078d2b388dda40491cf1957651fbe513e0d6d7fe4bca38b1
BLAKE2b-256 checksum
How to use checksums
2532688cdba3d5176b50c6c365951f442bd04e68bf43904fcf91120dd942636a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files

3.2.0

2 release files

3.1.1

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page