python-fire icon indicating copy to clipboard operation
python-fire copied to clipboard

Add time_tools example (now, to_seconds, add_seconds)

Open NA-V10 opened this issue 1 month ago • 0 comments

Summary

This PR adds a new example module time_tools to the examples/ directory. It follows the same format and structure as the existing Google examples such as cipher, including licensing headers, function layout, Fire usage style, and test patterns.

Details

  • New folder: examples/time_tools/
  • Provides simple time utility functions:
    • now() — returns the current datetime string
    • to_seconds(minutes, seconds) — converts to total seconds
    • add_seconds(time_string, seconds) — adds seconds to a datetime
  • Fire CLI is invoked without a target component, so all module functions become CLI commands, consistent with other examples.
  • Includes a full test suite built using testutils.BaseTestCase.

Checklist

  • [x] Example follows Google style (license header, naming, docstrings)
  • [x] Test file included following Google's cipher_test.py pattern
  • [x] No modifications to core Fire library
  • [x] CLA signed

NA-V10 avatar Nov 23 '25 03:11 NA-V10