Skip to main content

Canonical anatomy domain dataset and Neo4j graph builder for Stronger.

Project description

Stronger Anatomy (anatomy-graphdb)

Canonical anatomy domain package for Stronger.

This repository provides:

  • structured YAML anatomy data in config/
  • typed Python loaders/models in anatomy_graphdb
  • canonical catalog exports for downstream domains (anatomy_graphdb.exports)
  • a CLI (anatomy-graphdb) for validation and Neo4j export/ingestion
  • packaged cleaned overlay SVG assets in anatomy_graphdb/assets/

Install

Minimal package (no Neo4j driver)

pip install anatomy-graphdb

With Neo4j ingestion support

pip install "anatomy-graphdb[neo4j]"

Local development

poetry install

Standalone Usage

Load anatomy regions in Python

from anatomy_graphdb.databases.anatomy.loader import AnatomyLoader
from anatomy_graphdb.domain import build_anatomy_model

loader = AnatomyLoader()
region = loader.load_region("chest")
model = build_anatomy_model(region)

print(model.region)
print(len(model.muscles))

Access packaged overlay assets

from anatomy_graphdb.assets import load_overlay_manifest, asset_absolute_path

version, assets = load_overlay_manifest()
front_outline = assets["__base__"]["front"]
path = asset_absolute_path(front_outline)
print(version, path)

CLI

List available regions:

poetry run anatomy-graphdb --list-regions

Validate a region:

poetry run anatomy-graphdb --region chest --validate-only

Export CSV artifacts:

poetry run anatomy-graphdb --region all --output data/neo4j --validate

Export canonical anatomy catalog JSON:

poetry run anatomy-graphdb --export-catalog --region all --catalog-output data/catalog/anatomy_catalog.json

Direct Bolt ingestion (requires neo4j extra):

poetry run anatomy-graphdb --region all --mode bolt --validate

Integration Pattern (Your Multi-Repo Setup)

Recommended layering:

  1. stronger-domain-postgres: relational exercise/workout domain.
  2. anatomy-graphdb (this repo): anatomy graph domain + canonical overlay assets.
  3. stronger-api: composition layer that imports both domain packages.
  4. stronger-frontend: consumes API JSON + SVG asset URLs.

In your current setup, stronger-api imports this package and serves:

  • anatomy graph data from YAML-derived models
  • overlay manifest and SVG files from anatomy_graphdb/assets
  • catalog/version metadata for drift debugging

stronger-domain-postgres can consume --export-catalog output (or import exports directly) to seed canonical muscle_groups and muscles without duplicating anatomy configs.

The frontend should consume those API routes instead of maintaining duplicated anatomy SVG sources.

Asset Layout

Canonical packaged assets:

  • Manifest: anatomy_graphdb/assets/overlay_manifest.json
  • SVG files: anatomy_graphdb/assets/anatomy/*.svg

Legacy repo-only assets (not packaged into wheels):

  • svgs/svg_front_muscles
  • svgs/svg_rear_muscles
  • svgs/muscles
  • svgs/manifest.json

Those svgs/ folders are retained for historical/reference tooling only.

Neo4j Configuration

When using bolt mode, configure environment variables:

NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=password
NEO4J_DATABASE=neo4j

For AuraDB:

NEO4J_URI=neo4j+s://<instance-id>.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=<your-password>
NEO4J_DATABASE=neo4j

Then run:

poetry run anatomy-graphdb --region all --mode bolt --validate

Docker Graph Build

You can run Neo4j in Docker and build/populate the graph in one command:

make neo4j-refresh-docker REGION=all

Useful helpers:

make neo4j-up
make neo4j-logs
make neo4j-down

Override defaults when needed:

make neo4j-refresh-docker REGION=chest NEO4J_AUTH=neo4j/password HTTP_PORT=7475 BOLT_PORT=7688

Tests

poetry run pytest

Public API and Versioning

  • Stable API surface: docs/API_STABILITY.md
  • Changelog: CHANGELOG.md
  • Release process: docs/RELEASING.md
  • Asset attribution policy: docs/ASSET_ATTRIBUTION.md

Package Metadata

  • Package name: anatomy-graphdb
  • Python: 3.12+
  • License: MIT

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

anatomy_graphdb-1.0.0.tar.gz (289.4 kB view details)

Uploaded Source

Built Distribution

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

anatomy_graphdb-1.0.0-py3-none-any.whl (374.0 kB view details)

Uploaded Python 3

File details

Details for the file anatomy_graphdb-1.0.0.tar.gz.

File metadata

  • Download URL: anatomy_graphdb-1.0.0.tar.gz
  • Upload date:
  • Size: 289.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.17.0-14-generic

File hashes

Hashes for anatomy_graphdb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d5c91a7eee30cba056b73fc4713bcda96f565cf4769bd87e8dcb5a7cff02e60f
MD5 b5e832ecef3e08a5d23ef2c38e26ec13
BLAKE2b-256 fbff0ab929d1e90d12d4e73e03579987ee4298ac603bb2f2aaf0297d32c43290

See more details on using hashes here.

File details

Details for the file anatomy_graphdb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: anatomy_graphdb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 374.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.17.0-14-generic

File hashes

Hashes for anatomy_graphdb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 331b66703357a291a13297211de68012365b0fbdd279556116187772c925437c
MD5 6b416c96ca8ff0ceeed650c1e5f9349c
BLAKE2b-256 cadc57379b4b4a0721bbbb4ea38d645262e4529e93f01c2d0bdc3778031cff1a

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