Metadata-Version: 2.4
Name: FL-Net-Python-Tool-API
Version: 0.7.16
Summary: Python SDK and runtime for building FL-Net tools: local analyses, preprocessing, exports and federated learning apps
Author-email: Simon Süwer <simon.suewer@uni-hamburg.de>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/FedLearnNet/Python-Tool-API
Project-URL: Documentation, https://federated-learning.net/documentation/
Project-URL: Source, https://github.com/FedLearnNet/Python-Tool-API
Project-URL: Issues, https://github.com/FedLearnNet/Python-Tool-API/issues
Keywords: federated learning,fl-net,privacy,smpc,differential privacy,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websockets~=17.1
Requires-Dist: pydantic-yaml~=1.7
Requires-Dist: PyYAML~=6.0
Requires-Dist: watchdog~=6.0
Requires-Dist: pydantic~=2.13
Requires-Dist: psutil~=7.0
Requires-Dist: pydantic-settings~=2.15
Requires-Dist: requests~=2.34
Requires-Dist: numpy<3,>=1.26.4
Requires-Dist: pandas<3,>=2.2
Requires-Dist: validators~=0.35.0
Provides-Extra: images
Requires-Dist: Pillow; extra == "images"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: typing_extensions; extra == "test"
Provides-Extra: dev
Requires-Dist: FL-Net-Python-Tool-API[images,test]; extra == "dev"
Dynamic: license-file

# FL-Net Python Tool API

```bash
pip install "FL-Net-Python-Tool-API~=0.7.12"
```

The package is imported as `pyfedappwrap` (`from pyfedappwrap.engine.runtime import FedDBEngine`).
Use the distribution name `FL-Net-Python-Tool-API` in dependency files; `pyfedappwrap`
is the Python import name.

Python SDK and runtime for building **FL-Net tools** ("apps"): local analyses, preprocessing/transformer
steps, exports and federated learning apps. You implement the logic; pyfedappwrap handles the communication
with the platform, `app.yml` configuration, metrics, result upload, login during development and federated
aggregation (including SMPC and differential privacy settings).

Part of FL-Net, the federated learning platform also behind PosyMed.


## Documentation

All documentation can be found on the FL-Net documentation site:
- [FL-Net documentation](https://federated-learning.net/documentation/)
- [Federated runtime](https://federated-learning.net/documentation/docs/contribution-guide/python-tool-api/federated-runtime): how the engine runs a federated run internally


## Development

```bash
pip install -e ".[dev]"
pytest
```

| Folder | Content |
|---|---|
| `pyfedappwrap/` | The package |
| `tests/` | Test suite, with test apps in `tests/apps/`, configs in `tests/configs/` and input data in `tests/data/` |
| `examples/` | Example apps for tool authors |
| `scripts/` | Local dev runners, started from the repository root (`python -m scripts.run_local`) |
| `docker/` | Base image Dockerfiles, built by `.github/workflows/docker.yml` (`Dockerfile.local`: local builds only, see `dev_scripts/`) |
| `dev_scripts/` | `build_local_docker_image.sh`: builds `base-python-dep:testingtag` with this checkout, to test Tool API changes in the FL-Net-Sandbox |

Local settings go into `.env` (template: `.env.example`).

### Develop builds

`develop` carries the next version as `X.Y.Z.dev` (`.github/scripts/version.sh`), like all FL-Net repositories.
Every push to `develop` that changes the package is published to TestPyPI as `X.Y.Z.dev<run>`, since package indexes
never take a version twice, and all base images are rebuilt with it under the moving tags `X.Y.Z.dev` and `staging`.
A tool tries unreleased changes without a merge to `main`:

```dockerfile
FROM ghcr.io/fedlearnnet/python-tool-api/base-python-dep:0.7.15.dev
```

Only the SDK comes from TestPyPI, its dependencies come from PyPI.


## License

[Apache License 2.0](LICENSE) © Institute for Computational Systems Biomedicine and contributors.
