NeuronBridge Python API
A Python API for the NeuronBridge neuron similarity search service.
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
- Update the version in setup.py
- Push all changes and tag a release in GitHub
- Build PyPI distribution:
pixi run pypi-build
- 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neuronbridge_python-3.3.0.tar.gz | 16.5 kB | Without provenance | Details for neuronbridge_python-3.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neuronbridge_python-3.3.0-py3-none-any.whl | Python 3 | none | any | Details for neuronbridge_python-3.3.0-py3-none-any.whl |
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
|
Security for neuronbridge-python 3.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.