Flywheel Gear Development Toolkit
Project description
fw-gear
fw-gear is a Python package maintained by Flywheel that simplifies the development of Flywheel gears. It provides a comprehensive toolkit for interacting with gear runtime objects, managing inputs/outputs, and integrating with the Flywheel platform.
Note: The
fw-gearpackage is the successor to the olderflywheel-gear-toolkitpackage. New gear development should usefw-gear.
Features
- GearContext: Context manager for gear lifecycle management
- Access configuration values and input files
- Manage output files and directories
- Write metadata without SDK authentication
- Configure logging
- SDK Integration: Automatic Flywheel SDK client instantiation when API key provided
- Metadata Management: Update container and file metadata via
.metadata.json - Utilities: Command execution, ZIP management, resource monitoring, and more
- Nipype Integration: Generate Nipype interfaces from gear manifests
Installation
Basic Installation
pip install fw-gear
With Optional Dependencies
Install specific extras for additional functionality:
# Install with SDK support
pip install fw-gear[sdk]
# Install with all extras (SDK, Nipype, NumPy, psutil)
pip install fw-gear[all]
Available extras:
sdk: Flywheel SDK integrationnipype: Nipype workflow integrationnumpy: NumPy array supportmonitoring: Resource monitoring with psutilall: All optional dependencies
Quick Start
Create a simple gear in run.py:
from fw_gear.context import GearContext
def main(context):
# Get configuration
greeting = context.config.opts.get("greeting", "Hello")
# Get input file
input_file = context.config.get_input_path("input_file")
# Write output
with context.open_output("output.txt", "w") as f:
f.write(f"{greeting} from {input_file}\n")
if __name__ == "__main__":
with GearContext() as context:
context.init_logging()
main(context)
Documentation
Comprehensive documentation is available at: https://flywheel-io.gitlab.io/scientific-solutions/lib/fw-gear/
- Getting Started - Tutorial with practical examples
- GearContext Guide - Detailed usage guide
- Utils Module - Helper utilities
- API Reference - Complete API documentation
- Migration Guide - Migrating from flywheel-gear-toolkit
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on contributing.
License
fw-gear is released under the
MIT License.
Support
- Documentation: https://flywheel-io.gitlab.io/scientific-solutions/lib/fw-gear/
- Issues: GitLab Issue Tracker
- Flywheel Docs: https://docs.flywheel.io/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fw_gear-0.3.5-py3-none-any.whl.
File metadata
- Download URL: fw_gear-0.3.5-py3-none-any.whl
- Upload date:
- Size: 237.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eace62fc43ef91fbefd92ac5bf38b9d4083e249f7b00c0db6418f942277628cf
|
|
| MD5 |
97cebf72bdb2da9ead1760664ef89b71
|
|
| BLAKE2b-256 |
f5adbf4c9eac82f4244c984dc479d348a02be4232508636b87b0366351b1c94a
|