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/
Metadata
Release files for fw-gear 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fw_gear-0.3.7-py3-none-any.whl | Python 3 | none | any | Details for fw_gear-0.3.7-py3-none-any.whl |
Release files / fw_gear-0.3.7-py3-none-any.whl
| Download URL | fw_gear-0.3.7-py3-none-any.whl |
|---|---|
| Size | 237.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6121e58622427bc8d0c17924dae4c2b786b53383312c247b04e5213457f9857a
|
|
BLAKE2b-256 checksum How to use checksums |
e4f9035b3b93bd58dec8fdd2572412e17cfb3dd7b40e5aa3efa3cb32fdd09b5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for fw-gear 0.3.7
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.