All Versions
8
Latest Version
Avg Release Cycle
158 days
Latest Release
1155 days ago
Changelog History
Changelog History
-
v0.3.1 Changes
April 07, 2020โ Removes preexec_fn from pager subprocess call. Resolves #236.
-
v0.3.0 Changes
March 24, 2020Assorted Improvements in Python Fire v0.3.0
- ๐ Use Fire on third-party code without making any code changes:
python -m fire <module>
- ๐ Docstring parsing fix for all lines are blank f01aad3
- ๐ Improved parsing of numpy-style docstrings
- #187 Expose built-in functions from the standard library (e.g. sin, cos)
- #149 Support objects implementing __getattr__
- #205 Fix ctrl-C handling in help screens
- ๐ Support functools.wraps and lru_cache decorated functions
- ๐ Better support for objects with properties
- Objects with custom __str__ are now treated as Values. E.g. If such an object appears in a dict, the dict will still print in line-by-line mode rather than showing a help screen by default.
- ๐ Formatting on Windows works properly now
- ๐ Use Fire on third-party code without making any code changes:
-
v0.2.1 Changes
August 01, 2019๐ Bug fixes
- ๐ Improves robustness of docstring parser in the face of unexpected format docstrings. #183
-
v0.2.0 Changes
July 26, 2019Python Fire v0.2.0
If you're new to Python Fire:
๐ฑ 1. 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. - Access --help naturally
You no longer need to separate --help from your command with an extra --. Simply runningcommand -h
orcommand --help
will give help, provided there isn't an argument namedhelp
in your component. - NamedTuples can be indexed both by their field names and by their indexes.
- Callable objects can both be called, and their members can be accessed.
You must use flag syntax to call a callable object; you cannot pass their arguments positionally. - ๐ Single-hyphen flags are supported
You can now specify-flag
instead of--flag
if preferred. Both work. - Short-flags are permitted when their use is unambiguous
E.g. if your function has argumentalpha
, then you can specify its value with-a
. - ๐ Fish completion support
-
v0.1.3 Changes
February 23, 2018 -
v0.1.2 Changes
August 29, 2017๐ Improvements
- IPython is fully optional! [#7]
Now Fire's only dependency is six (the Python 2, 3 compatibility module) which is fairly light weight.
If you use Fire without IPython, we call it "Fire Lite." Pun intended. - The command argument accepts lists [#53]
fire.Fire's optionalcommand
argument now accepts either a sequence of arguments or a single string.
Previously thecommand
argument only accepted a string. - ๐ New mkdocs documentation
๐ We've started using mkdocs for documentation. The documentation is available at https://google.github.io/python-fire. - ๐ Packaging improvements: the license file is now included in the release.
- Output is no longer force converted to ASCII.
- IPython is fully optional! [#7]
-
v0.1.1 Changes
May 21, 2017๐ New Features
- The Python Fire Guide is available
- ๐ Support for annotations in functions
- ๐ Support for keyword-only arguments in functions
- Faster loading via lazy imports
๐ Bug Fixes
- Serialize empty dictionaries
- Serialize dictionaries with circular dependencies
- ๐ Support non-comparable objects, numpy arrays, etc
- Help for objects without source files
- Completion scripts for top-level functions
-
v0.1.0
March 29, 2017