v0.2.0
Python Fire v0.2.0
If you're new to Python Fire:
- Welcome! ๐
- Fire automatically generates command line interfaces from any Python object you give it. ๐ฅ
e.g. You can call Fire on a function, as in this example (but you can also call Fire on anything else: classes, objects, dicts, etc. -- they all work.)
def hello(name="World"):
return "Hello %s!" % name
fire.Fire(hello)
hello.py --name=David # Hello David!
pip install fire to get started.
Improvements in v0.2.0
- Help and usage screens Help screens now have a man-page appearance and are shown with less-style pagination. Usage screens are shown when a user-error is encountered. The help and usage screens are considerably cleaner than the default output in previous versions of Fire.
- Custom serialization
If you define a custom
__str__method on an object, that will be used to serialize the object when it is the final result of a Fire command. This means better support for numpy arrays, and better support for custom types. - Docstring parsing Notably, docstrings are parsed in order to determine the descriptions to use for arguments in the help screens. We largely support (but not fully) Google, numpy, and RST style docstrings. These are the three most common styles of docstring used in Python code.