{"id":27309,"library":"python-fire","title":"Python Fire","description":"Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. Current version is 0.1.0. Release cadence is irregular; last release was in 2018.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/grub/python-fire","tags":["cli","command-line","fire","automation"],"install":[{"cmd":"pip install python-fire","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"fire","correct":"import fire"},{"note":"Fire is a function in the fire module, not a top-level import.","wrong":"from fire import Fire","symbol":"Fire","correct":"fire.Fire"}],"quickstart":{"code":"import fire\n\ndef hello(name=\"World\"):\n  return \"Hello %s!\" % name\n\nif __name__ == '__main__':\n  fire.Fire(hello)","lang":"python","description":"Basic CLI generation from a function."},"warnings":[{"fix":"Use Fire alone for CLI entry points, or call fire.Fire() only when __name__ == '__main__'.","message":"Fire uses argument parsing that may conflict with argparse or click if used in the same script. Avoid mixing libraries that parse sys.argv.","severity":"gotcha","affected_versions":"all"},{"fix":"Provide explicit help strings or use docstrings to guide parsing.","message":"Fire's type inference is limited; it may not properly handle complex types like custom classes or nested objects. It works best with simple types.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to Typer (pip install typer) for modern CLI generation.","message":"Python Fire 0.1.0 is very old (2018). It has known bugs and no active maintenance. Consider alternatives like Typer or Click.","severity":"deprecated","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'import fire' then call 'fire.Fire(function)'.","cause":"Importing Fire incorrectly as a class or attribute from fire module.","error":"'Fire' object is not callable"},{"fix":"Use classes with Fire by calling fire.Fire(ClassName) and ensure methods return strings or use --help.","cause":"Fire may interpret a class's __init__ as the default command but return a string when instantiated, causing confusion.","error":"TypeError: 'str' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}