semvec/pypi-packages huggingface dataset:
franklinwh 1.0.0
Python wrapper for FranklinWH
Requires Python: >=3.8

# franklinwh-python

Python bindings to the FranklinWH API, such as it is.

In order to use this, you'll need an access token, and your gateway ID. There's a bundled script which can generate an access token, your gateway ID can be found in the app under More -> Site Address. It's shown as your SN.

```bash
python3 -m pip install franklinwh
```

## Informational scripts

Scripts in [bin](./bin) use the API to show detailed information about your installation but have extra dependencies, install with

```bash
python3 -m pip install franklinwh[bin]
```

Most scripts require email address, password, and probably gateway id (referenced above).

```bash
python3 bin/get_info.py $FRANKLINWH_EMAIL $FRANKLINWH_PASSWORD $FRANKLINWH_GATEWAY_ID
```

## Development

The [Makefile](./Makefile) has a target to assist development and eventual release:

- `prepare` - run this once to install `franklinwh` in **editable mode** and prerequisites for bin and build.

This should be run in the context where you will eventually develop, which could be

- [franklinwh-python](#franklinwh-python)

  In this case a [virtual environment](https://www.w3schools.com/python/python_virtualenv.asp) is recommended.

  ```bash
  python3 -m venv .venv
  source .venv/bin/activate
  ```

- [Home Assistant Core](https://github.com/home-assistant/core) with [FranklinWH integration](https://github.com/richo/homeassistant-franklinwh)

  This has too many permutations to discuss here but is a primary use for this API.

```bash
make prepare
```

## Release

The [Makefile](./Makefile) has targets to assist the release process:

- `build` - build the distribution.
- `release` - upload to PyPi.

The release process involves these steps:

- bump and commit version

  [pyproject.toml/project/version](./pyproject.toml) must be unique and conform to [semantic versioning](https://semver.org/).

> [!NOTE]
> This may already be included in a [Pull Request](<https://github.com/richo/franklinwh-python/pulls>).

- build

  ```bash
  make build
  ```

  Fix any errors and commit the changes.

- upload

  ```bash
  make release
  ```
neuroimaging 1.0.0
3D brain MRI segmentation with a packaged UNet3D trained model and simple inference API.
Requires Python: >=3.10

# Library quickstart

Minimal, copy-pasteable way to predict the packaged TorchScript model on your own NIfTI image

```python
from pathlib import Path

from neuroimaging import VolumeSegmenter, Transforms

image_path = Path("path/to/your_scan.nii.gz")
device = "cpu"

input_tensor = VolumeSegmenter.prepare_input(image_path, device=device)

preprocessor = Transforms.normalize_input()
normalized_data = preprocessor({"image": input_tensor})
input_tensor = normalized_data["image"].to(device)

segmenter = VolumeSegmenter.from_pretrained(device=device)
mask = segmenter.predict(
    input_tensor, output_path=image_path.with_name("predicted_mask.nii.gz")
)
```

# Model

## Development

### Install uv

https://docs.astral.sh/uv/getting-started/installation/


```bash
uv venv                                     # creates venv
uv sync --all-extras --dev                  # installs dependencies on venv
uv run -m segmentation.examples.models      # this is how to run .py files
```

Format code with ruff
```bash
uv run ruff check --select I --fix    # format imports, or run without --fix to check only
uv run ruff format                    # format code, or run with --check
```

Check typing
```bash
uv run mypy . --config-file pyproject.toml  # runs type linter
```