Skip to main content

VFBquery

PyPI Documentation

VFBquery is the query layer of Virtual Fly Brain (VFB) — the Drosophila nervous-system atlas. It turns the identifiers VFB users work with (FBbt_... anatomy classes, VFB_... individuals) into the rich, cross-referenced reports the VFB website shows: term metadata, aligned images, connectivity, transcriptomics, similar neurons, stocks and publications. It is both a Python package and the HTTP backend that serves those results to the VFB site and to third-party tools.

How it works

VFBquery sits in front of the VFB data stores and does the fan-out for you:

  • Solr holds pre-built term_info documents and powers free-text search — most lookups are answered from here in milliseconds.
  • Neo4j (the VFB knowledge graph) answers the relational questions: connectivity, cross-references, images by template, dataset membership.
  • Owlery (an OWL reasoner) answers the ontology queries that need reasoning rather than lookup.
  • A Solr-backed result cache stores computed results with a three-month TTL and version-based invalidation, so repeated queries are effectively instant — see CACHING.md.

The same functions are exposed two ways: imported as a Python package, or served over HTTP by the bundled high-availability server (vfbquery.ha_api), which adds request coalescing, queueing, backpressure and its own short-lived result cache. The VFB website's term-information panels are drawn from this service.

Install

pip install --upgrade vfbquery

Python 3.8+. Installing pulls the full server dependency set; if you only want to call a deployed HTTP API, the lightweight vfbquery-client needs just requests and pandas.

Quick start

import vfbquery as vfb

# Term information for an anatomy class or an individual neuron:
vfb.get_term_info('FBbt_00003748')            # medulla
vfb.get_term_info('VFB_00101567')             # JRC2018Unisex template

# The queries the website offers for a term, runnable directly, e.g.:
vfb.get_instances('FBbt_00003748', return_dataframe=False)

# Connectivity between neuron types:
vfb.query_connectivity(upstream_type='LPLC2', downstream_type='giant fiber neuron')

# Pass-through to the VFB-hosted CATMAID servers (FAFB, FANC, L1EM, ...),
# addressing neurons by skid or VFB id interchangeably:
from vfbquery import catmaid
catmaid('fafb').connectivity(ids=['VFB_001011rj'])
catmaid('fafb').swc(id='VFB_001011rj', aligned='JRC2018Unisex')

Every function is documented, with runnable examples, in the interactive API documentation described below, and in the Python client guide.

The HTTP API

python -m vfbquery.ha_api starts the server (default port 8080). Its root page is interactive API documentation in the style of the VFB-hosted CATMAID /apis/ pages: every endpoint with its parameters, pre-filled runnable examples, and live results — open / on any deployment, for example the production instance at https://v3-cached.virtualflybrain.org/. The machine-readable version is at /docs.json.

The endpoint surface mirrors the Python package: /get_term_info, /run_query, /search, /xref, /combine, /query_connectivity, /get_hierarchy, the FlyBase stock and combination resolvers, and the /catmaid/... pass-through. The full HTTP reference lives at vfbquery.readthedocs.io.

Documentation

Development

Tests live in src/test/ (package-level, run against the live VFB backend) and tests/ (HA-API unit tests). The canonical worked examples are a real test, src/test/test_example_queries.py: CI runs them against production and compares each result's shape to the recording in src/test/example_expected/, so the examples cannot rot; when a schema change is intentional, python -m src.test.test_example_queries --record refreshes the recordings. pip install -r requirements.txt -r tests/requirements.txt, then pytest.

See TESTING.md for how to write a test that fits the CI policy, and .github/workflows/README.md for what each CI workflow does, when it runs, and which can block a PR.

Licence

GPL-3.0. Please cite Court et al. (2023), Virtual Fly Brain — an interactive atlas of the Drosophila nervous system when VFB data or services contribute to a publication.

Metadata

Release files for vfbquery 1.22.60

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

Source distribution (sdist)

Source distribution for vfbquery 1.22.60
File Size Uploaded Provenance Actions
vfbquery-1.22.60.tar.gz 478.3 kB With provenance Details for vfbquery-1.22.60.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vfbquery 1.22.60
File Interpreter ABI Platform Actions
vfbquery-1.22.60-py3-none-any.whl Python 3 none any Details for vfbquery-1.22.60-py3-none-any.whl

Total release size: 930.1 kB

Release files / vfbquery-1.22.60.tar.gz

Download URL vfbquery-1.22.60.tar.gz
Size 478.3 kB
Tags Source
SHA-256 checksum
How to use checksums
84e1c726dd0ae112d59d4fd4c99da11d4702709b41de70f025e2d01834a5eb17
BLAKE2b-256 checksum
How to use checksums
bc10bd524cb87b9ff832c14dd8d2b0efe8b628a1df34ee6b0b515663933fcd44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / vfbquery-1.22.60-py3-none-any.whl

Download URL vfbquery-1.22.60-py3-none-any.whl
Size 451.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60d34271fcbaa3e823ae550e6fae9e26b77ac8b3bbb62e9ffdf06c3bc593a7ae
BLAKE2b-256 checksum
How to use checksums
ca53f50d45c3647f5eb6c04679f34f2b96e2d10e4565ca5496000b5e6c1bd333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for vfbquery 1.22.60

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vfbquery-1.22.60.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.22.60 This release

2 release files Full provenance

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