Add Python Fire support (#550)

This commit is contained in:
eugen-ajechiloae-clearml
2022-02-07 13:38:11 +02:00
committed by GitHub
parent 9794135aed
commit 296cb7d899
9 changed files with 443 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
# ClearML - Example of Python Fire integration, processing multiple commands, when fire is initialized with no component
#
from clearml import Task
import fire
def hello(count, name="clearml", prefix="prefix_", suffix="_suffix", **kwargs):
for _ in range(count):
print("Hello %s%s%s!" % (prefix, name, suffix))
def serve(addr, port, should_serve=False):
if not should_serve:
print("Not serving")
else:
print("Serving on %s:%s" % (addr, port))
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire multi command")
fire.Fire()