PySNT
Python wrapper for SNT, the framework for quantification of neuronal anatomy
Technical Features
-
Complete Java Bridge: Full programmatic access to SNT's neuroanatomy toolkit from Python (via JPype and ScyJava), enabling integration of advanced tracing, analysis, and visualization capabilities into Python workflows
-
Consistent API: 1:1 correspondence with SNT's Java API while maintaining Python conventions, allowing developers familiar with either language to work efficiently
-
Full Type Annotation: Type hints for all methods and classes, enabling static type checking with mypy and improved code reliability
-
IDE Integration: Autocomplete, inline documentation, and parameter hints in VS Code, PyCharm, Spyder, and Jupyter notebooks through type stubs and docstrings
-
Performant: Lazy class loading minimizes initialization overhead, loading only required SNT components on demand
-
Native Python Converters: Automatic conversion between SNT objects and Python-native types:
SNT Java Object PySNT Python Object SNTChart matplotlib Figure SNTGraph NetworkX graph SNTTable xarray Dataset; pandas DataFrame ImagePlus xarray; numpy (via ScyJava) Collections lists/dicts, etc. (via ScyJava)
Limitations
-
Pre-release: PySNT 5.0 is under active development and targets SNT 5.0.x: Expect bugs and API changes until the first stable release
-
Early Stage Software: Limited community validation. Please report anything unexpected
Getting Started for Users
See Install instructions.
Getting Started for Developers
Environment Setup
# 1. Clone the repository
git clone https://github.com/morphonets/pysnt.git
cd pysnt
# 2. Create and activate a virtual environment (Python 3.11+, JDK 21 available)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3. Install PySNT in development mode, with all optional and dev dependencies
pip install -e ".[dev]"
# 4. Verify the setup
python -c "import pysnt; print(pysnt.version())"
python -m pytest tests -q
# 5. Have a look at ./dev/README.md for common workflows
Prefer conda/mamba? mamba env create -f environment-dev.yml && mamba activate pysnt-dev && pip install -e .[dev]
does the same. Select the resulting interpreter in your IDE (see the
install docs).
Project Structure
pysnt/
├── src/pysnt/ # main package source (one subpackage per curated SNT package)
├── tests/ # test suite (JVM-dependent tests skip themselves if SNT cannot be resolved)
├── docs/ # documentation source (Sphinx/MyST) and tutorial notebooks
├── dev/ # development utilities and templates (see dev/README.md)
├── dev/scripts/ # SNT sync, stub generation, and documentation scripts
├── .github/workflows/ # CI: tests, lowest-dependency tests, docs build
├── pyproject.toml # packaging metadata, dependency floors, and extras
├── requirements*.txt # pip equivalents (core, optional features, development)
└── environment*.yml # conda-compatible equivalents (min, full, development)
Dependencies
pyproject.toml contains all details: core dependencies are listed under dependencies, and optional
features under extras (display, gui, java, info, all, dev, docs). The requirements*.txt and
environment*.yml files mirror it; The floors are verified by the "lowest declared dependencies" CI job.
Versioning and SNT
PySNT's major.minor version matches the SNT release it targets (PySNT 5.1.x targets SNT 5.1.x); the patch number is
independent, so PySNT can ship fixes without a new SNT release. By default, pysnt.initialize() downloads
SNT from Maven at DEFAULT_SNT_VERSION (see src/pysnt/_endpoints.py). Users can override it with
initialize(snt_version=...) or SNT_VERSION, or use a local Fiji instead. PySNT warns when the loaded SNT differs in
major.minor. See dev/README.md for the update workflow.
Need Help?
- 📖 Documentation: pysnt.readthedocs.io
- 💬 Forum: forum.image.sc/tag/snt
- 🐛 Issues: GitHub Issues
Metadata
Release files for pysnt 5.0.24
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 |
|---|---|---|---|---|
| pysnt-5.0.24.tar.gz | 233.2 kB | Without provenance | Details for pysnt-5.0.24.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysnt-5.0.24-py3-none-any.whl | Python 3 | none | any | Details for pysnt-5.0.24-py3-none-any.whl |
Total release size: 472.6 kB
Release files / pysnt-5.0.24.tar.gz
| Download URL | pysnt-5.0.24.tar.gz |
|---|---|
| Size | 233.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c77fffd52166e4392a01614434d9416ae3adc9da0b35dcb285fcc3fd1168d8c7
|
|
BLAKE2b-256 checksum How to use checksums |
f4828be04076126691d1464e8d3987262e34397ff44a01bc246df8c673f77cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.11
|
Release files / pysnt-5.0.24-py3-none-any.whl
| Download URL | pysnt-5.0.24-py3-none-any.whl |
|---|---|
| Size | 239.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f087f9905e262fd936770f199b1d988d83571bac11b4fec072b8b55070c489e
|
|
BLAKE2b-256 checksum How to use checksums |
de32f7e79bc98c7839040f58de867e5c182d1f28fb5f950eac96a7ea5e0f380c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.11
|
Security for pysnt 5.0.24
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.