lyrics-transcriber 0.49.2__py3-none-any.whl → 0.50.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,10 @@
1
1
  from lyrics_transcriber.core.config import TranscriberConfig, LyricsConfig, OutputConfig
2
2
  from lyrics_transcriber.core.controller import LyricsTranscriber
3
+ from importlib.metadata import version, PackageNotFoundError
4
+
5
+ try:
6
+ __version__ = version("lyrics-transcriber")
7
+ except PackageNotFoundError:
8
+ __version__ = "unknown"
3
9
 
4
10
  __all__ = ["LyricsTranscriber", "TranscriberConfig", "LyricsConfig", "OutputConfig"]
@@ -181,6 +181,13 @@ def validate_args(args: argparse.Namespace, parser: argparse.ArgumentParser, log
181
181
  def main() -> None:
182
182
  """Main entry point for the CLI."""
183
183
  parser = create_arg_parser()
184
+
185
+ # Check if --help or -h is in sys.argv to handle direct module execution
186
+ import sys
187
+ if '--help' in sys.argv or '-h' in sys.argv:
188
+ parser.print_help()
189
+ return
190
+
184
191
  args = parse_args(parser)
185
192
 
186
193
  # Set up logging first
@@ -244,3 +251,6 @@ def main() -> None:
244
251
  # Log both the error message and the full traceback
245
252
  logger.error(f"Processing failed: {str(e)}\n\nFull traceback:\n{error_details}")
246
253
  exit(1)
254
+
255
+ if __name__ == "__main__":
256
+ main()