python-fitparse 2.2.0__tar.gz → 2.3.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fitparse
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Python library to parse ANT/Garmin .FIT files
5
5
  Project-URL: Homepage, https://github.com/nbr23/python-fitparse
6
6
  Project-URL: Repository, https://github.com/nbr23/python-fitparse
@@ -2,6 +2,7 @@
2
2
  # *************************** DO NOT EDIT THIS FILE ****************************
3
3
  # *********** EXPORTED PROFILE FROM SDK VERSION 21.205 ON 2026-06-02 ***********
4
4
  # ********* PARSED 201 TYPES (4399 VALUES), 124 MESSAGES (1412 FIELDS) *********
5
+ # ***************************** APPLIED 2 PATCHES ******************************
5
6
 
6
7
  from fitparse.records import (
7
8
  ComponentField,
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-fitparse"
7
- version = "2.2.0"
7
+ version = "2.3.0"
8
8
  description = "Python library to parse ANT/Garmin .FIT files"
9
9
  authors = [
10
10
  {name = "David Cooper", email = "dave@kupesoft.com"},
@@ -644,12 +644,15 @@ def load_field_type_patches():
644
644
 
645
645
  def apply_patches(type_list, message_list):
646
646
  print("Loading patches...")
647
+ applied = 0
648
+
647
649
  field_type_patches = load_field_type_patches()
648
650
  if field_type_patches:
649
651
  print(f"Applying {len(field_type_patches)} field type patches...")
650
652
  for patch_name, patch_type_info in field_type_patches.items():
651
653
  if not type_list.get(patch_name, raise_exception=False):
652
654
  type_list.types.append(patch_type_info)
655
+ applied += 1
653
656
  print(f" Added field type: {patch_name}")
654
657
  else:
655
658
  print(f" Skipped field type: {patch_name} (already exists in generated profile)")
@@ -666,6 +669,7 @@ def apply_patches(type_list, message_list):
666
669
 
667
670
  if not existing_message:
668
671
  message_list.messages.append(patch_message_info)
672
+ applied += 1
669
673
  print(f" Added message type: {patch_message_info.name} (num: {patch_num})")
670
674
  else:
671
675
  existing_nums = {normalize_def_num(f.num) for f in existing_message.fields}
@@ -674,8 +678,11 @@ def apply_patches(type_list, message_list):
674
678
  print(f" Skipped field: {existing_message.name}.{patch_field.name} (def_num {patch_field.num} already defined)")
675
679
  else:
676
680
  existing_message.fields.append(patch_field)
681
+ applied += 1
677
682
  print(f" Added field: {existing_message.name}.{patch_field.name} (def_num {patch_field.num})")
678
683
 
684
+ return applied
685
+
679
686
 
680
687
  def download_latest_sdk(path):
681
688
  repo_url = 'https://api.github.com/repos/garmin/fit-sdk-tools/releases/latest'
@@ -746,7 +753,7 @@ def main(input_xls_or_zip, output_py_path=None):
746
753
  type_list = parse_types(types_rows)
747
754
  message_list = parse_messages(messages_rows, type_list)
748
755
 
749
- apply_patches(type_list, message_list)
756
+ patches_applied = apply_patches(type_list, message_list)
750
757
 
751
758
  mesg_num_declarations = []
752
759
  for mesg_name in MESSAGE_NUM_DECLARATIONS:
@@ -779,6 +786,7 @@ def main(input_xls_or_zip, output_py_path=None):
779
786
  len(type_list.types), sum(len(ti.values) for ti in type_list.types),
780
787
  len(message_list.messages), sum(len(mi.fields) for mi in message_list.messages),
781
788
  )),
789
+ header('APPLIED %d PATCH%s' % (patches_applied, '' if patches_applied == 1 else 'ES')),
782
790
  '', IMPORT_HEADER
783
791
  ]) + '\n'
784
792
 
File without changes