zpdatafetch 2.0.2__tar.gz → 2.0.3__tar.gz

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.
Files changed (69) hide show
  1. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/PKG-INFO +1 -1
  2. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/pyproject.toml +1 -1
  3. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/cli.py +25 -0
  4. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/cli.py +13 -15
  5. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch.egg-info/PKG-INFO +1 -1
  6. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/LICENSE +0 -0
  7. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/README.md +0 -0
  8. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/setup.cfg +0 -0
  9. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/__init__.py +0 -0
  10. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/config.py +0 -0
  11. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/error_helpers.py +0 -0
  12. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/exceptions.py +0 -0
  13. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/http_client.py +0 -0
  14. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/json_helpers.py +0 -0
  15. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/logging.py +0 -0
  16. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/shared/validation.py +0 -0
  17. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/__init__.py +0 -0
  18. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/activity.py +0 -0
  19. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/auth.py +0 -0
  20. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/config.py +0 -0
  21. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/followers.py +0 -0
  22. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/logging_config.py +0 -0
  23. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/profile.py +0 -0
  24. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/rideons.py +0 -0
  25. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/ridersinworld.py +0 -0
  26. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zdatafetch/worlds.py +0 -0
  27. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/__init__.py +0 -0
  28. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/async_zp.py +0 -0
  29. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/cli.py +0 -0
  30. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/config.py +0 -0
  31. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/logging_config.py +0 -0
  32. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zp.py +0 -0
  33. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zp_obj.py +0 -0
  34. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zp_utils.py +0 -0
  35. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpcyclist.py +0 -0
  36. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpcyclistfetch.py +0 -0
  37. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpleague.py +0 -0
  38. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpleaguefetch.py +0 -0
  39. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpprime.py +0 -0
  40. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpprimesfetch.py +0 -0
  41. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpracefinish.py +0 -0
  42. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpracelog.py +0 -0
  43. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpraceresult.py +0 -0
  44. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpracesignup.py +0 -0
  45. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpracesprint.py +0 -0
  46. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpresultfetch.py +0 -0
  47. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpsignupfetch.py +0 -0
  48. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpsprintsfetch.py +0 -0
  49. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpteam.py +0 -0
  50. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch/zpteamfetch.py +0 -0
  51. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch.egg-info/SOURCES.txt +0 -0
  52. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch.egg-info/dependency_links.txt +0 -0
  53. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch.egg-info/entry_points.txt +0 -0
  54. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch.egg-info/requires.txt +0 -0
  55. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zpdatafetch.egg-info/top_level.txt +0 -0
  56. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/__init__.py +0 -0
  57. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/async_zr.py +0 -0
  58. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/cli.py +0 -0
  59. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/config.py +0 -0
  60. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/logging_config.py +0 -0
  61. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/rate_limiter.py +0 -0
  62. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zr.py +0 -0
  63. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zr_utils.py +0 -0
  64. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zrraceresult.py +0 -0
  65. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zrresultfetch.py +0 -0
  66. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zrrider.py +0 -0
  67. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zrriderfetch.py +0 -0
  68. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zrteamfetch.py +0 -0
  69. {zpdatafetch-2.0.2 → zpdatafetch-2.0.3}/src/zrdatafetch/zrteamroster.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zpdatafetch
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: A package for fetching data from Zwiftpower and Zwiftracing.app
5
5
  Author-email: Doug Morris <doug@mhost.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "zpdatafetch"
3
- version = "2.0.2"
3
+ version = "2.0.3"
4
4
  description = "A package for fetching data from Zwiftpower and Zwiftracing.app"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -7,17 +7,35 @@ functionality for both zpdatafetch and zrdatafetch CLIs.
7
7
  import logging
8
8
  from argparse import ArgumentParser, Namespace
9
9
  from collections.abc import Callable
10
+ from importlib.metadata import PackageNotFoundError, version
11
+
12
+
13
+ def get_package_version(package_name: str = 'zpdatafetch') -> str:
14
+ """Get version from installed package metadata.
15
+
16
+ Args:
17
+ package_name: Name of the package to get version for
18
+
19
+ Returns:
20
+ Version string from package metadata, or 'unknown' if not found
21
+ """
22
+ try:
23
+ return version(package_name)
24
+ except PackageNotFoundError:
25
+ return 'unknown'
10
26
 
11
27
 
12
28
  def create_base_parser(
13
29
  description: str,
14
30
  command_metavar: str,
31
+ package_name: str = 'zpdatafetch',
15
32
  ) -> ArgumentParser:
16
33
  """Create argument parser with common CLI arguments.
17
34
 
18
35
  Args:
19
36
  description: CLI description text
20
37
  command_metavar: Metavar for command choices (e.g., '{config,rider,result}')
38
+ package_name: Name of package for version string (default: 'zpdatafetch')
21
39
 
22
40
  Returns:
23
41
  ArgumentParser configured with common arguments for both packages.
@@ -25,6 +43,13 @@ def create_base_parser(
25
43
  """
26
44
  parser = ArgumentParser(description=description)
27
45
 
46
+ # Version argument
47
+ parser.add_argument(
48
+ '--version',
49
+ action='version',
50
+ version=f'%(prog)s {get_package_version(package_name)}',
51
+ )
52
+
28
53
  # Logging arguments
29
54
  parser.add_argument(
30
55
  '-v',
@@ -10,6 +10,7 @@ from argparse import ArgumentParser
10
10
  from shared.cli import (
11
11
  configure_logging_from_args,
12
12
  format_noaction_output,
13
+ get_package_version,
13
14
  handle_config_command,
14
15
  validate_command_name,
15
16
  validate_command_provided,
@@ -55,6 +56,13 @@ Commands:
55
56
  # Create parser (custom for zdatafetch, no --v1fetch)
56
57
  p = ArgumentParser(description=desc)
57
58
 
59
+ # Version argument
60
+ p.add_argument(
61
+ '--version',
62
+ action='version',
63
+ version=f'%(prog)s {get_package_version()}',
64
+ )
65
+
58
66
  # Logging arguments
59
67
  p.add_argument(
60
68
  '-v',
@@ -223,9 +231,7 @@ Commands:
223
231
  for rider_id, profile in profiles.items():
224
232
  # Indent the profile output
225
233
  profile_str = str(profile)
226
- indented = '\n'.join(
227
- f' {line}' for line in profile_str.split('\n')
228
- )
234
+ indented = '\n'.join(f' {line}' for line in profile_str.split('\n'))
229
235
  print(f' {rider_id}: {indented.lstrip()},')
230
236
  print('}')
231
237
 
@@ -267,9 +273,7 @@ Commands:
267
273
  print('{')
268
274
  for rider_id, followers in followers_data.items():
269
275
  followers_str = str(followers)
270
- indented = '\n'.join(
271
- f' {line}' for line in followers_str.split('\n')
272
- )
276
+ indented = '\n'.join(f' {line}' for line in followers_str.split('\n'))
273
277
  print(f' {rider_id}: {indented.lstrip()},')
274
278
  print('}')
275
279
 
@@ -334,9 +338,7 @@ Commands:
334
338
  print('{')
335
339
  for key, rideons in rideons_data.items():
336
340
  rideons_str = str(rideons)
337
- indented = '\n'.join(
338
- f' {line}' for line in rideons_str.split('\n')
339
- )
341
+ indented = '\n'.join(f' {line}' for line in rideons_str.split('\n'))
340
342
  print(f' {key}: {indented.lstrip()},')
341
343
  print('}')
342
344
 
@@ -370,9 +372,7 @@ Commands:
370
372
  print('{')
371
373
  for rider_id, activity in activities.items():
372
374
  activity_str = str(activity)
373
- indented = '\n'.join(
374
- f' {line}' for line in activity_str.split('\n')
375
- )
375
+ indented = '\n'.join(f' {line}' for line in activity_str.split('\n'))
376
376
  print(f' {rider_id}: {indented.lstrip()},')
377
377
  print('}')
378
378
 
@@ -445,9 +445,7 @@ Commands:
445
445
  print('{')
446
446
  for world_id, riders in riders_data.items():
447
447
  riders_str = str(riders)
448
- indented = '\n'.join(
449
- f' {line}' for line in riders_str.split('\n')
450
- )
448
+ indented = '\n'.join(f' {line}' for line in riders_str.split('\n'))
451
449
  print(f' {world_id}: {indented.lstrip()},')
452
450
  print('}')
453
451
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zpdatafetch
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: A package for fetching data from Zwiftpower and Zwiftracing.app
5
5
  Author-email: Doug Morris <doug@mhost.com>
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes