arkparser 0.5.3__tar.gz → 0.5.4__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 (61) hide show
  1. {arkparser-0.5.3 → arkparser-0.5.4}/PKG-INFO +1 -1
  2. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/__init__.py +1 -1
  3. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/data_models.py +25 -2
  4. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/PKG-INFO +1 -1
  5. {arkparser-0.5.3 → arkparser-0.5.4}/pyproject.toml +1 -1
  6. {arkparser-0.5.3 → arkparser-0.5.4}/LICENSE +0 -0
  7. {arkparser-0.5.3 → arkparser-0.5.4}/README.md +0 -0
  8. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/__init__.py +0 -0
  9. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/binary_reader.py +0 -0
  10. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/exceptions.py +0 -0
  11. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/map_config.py +0 -0
  12. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/normalization.py +0 -0
  13. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/types.py +0 -0
  14. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/common/version_detection.py +0 -0
  15. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/export.py +0 -0
  16. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/__init__.py +0 -0
  17. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/base.py +0 -0
  18. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/cloud_inventory.py +0 -0
  19. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/profile.py +0 -0
  20. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/tribe.py +0 -0
  21. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/files/world_save.py +0 -0
  22. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/__init__.py +0 -0
  23. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/container.py +0 -0
  24. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/game_object.py +0 -0
  25. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/game_objects/location.py +0 -0
  26. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/__init__.py +0 -0
  27. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/base.py +0 -0
  28. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/byte_property.py +0 -0
  29. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/compound.py +0 -0
  30. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/primitives.py +0 -0
  31. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/properties/registry.py +0 -0
  32. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/__init__.py +0 -0
  33. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/base.py +0 -0
  34. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/colors.py +0 -0
  35. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/misc.py +0 -0
  36. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/property_list.py +0 -0
  37. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/registry.py +0 -0
  38. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser/structs/vectors.py +0 -0
  39. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/SOURCES.txt +0 -0
  40. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/dependency_links.txt +0 -0
  41. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/requires.txt +0 -0
  42. {arkparser-0.5.3 → arkparser-0.5.4}/arkparser.egg-info/top_level.txt +0 -0
  43. {arkparser-0.5.3 → arkparser-0.5.4}/setup.cfg +0 -0
  44. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_asa_header_position.py +0 -0
  45. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_asa_name_table.py +0 -0
  46. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_ase_cluster_drift.py +0 -0
  47. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_binary_reader.py +0 -0
  48. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_binary_reader_layouts.py +0 -0
  49. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_cloud_export.py +0 -0
  50. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_cloud_inventory.py +0 -0
  51. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_cryopod_export.py +0 -0
  52. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_current_stats.py +0 -0
  53. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_data_models.py +0 -0
  54. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_export.py +0 -0
  55. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_game_objects.py +0 -0
  56. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_profile.py +0 -0
  57. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_review_fixes.py +0 -0
  58. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_tribe.py +0 -0
  59. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_v13_property_layouts.py +0 -0
  60. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_version_detection.py +0 -0
  61. {arkparser-0.5.3 → arkparser-0.5.4}/tests/test_world_save.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arkparser
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: Pure Python parser for ARK: Survival Evolved and ARK: Survival Ascended save files
5
5
  Author: Vertyco
6
6
  License-Expression: MIT
@@ -95,4 +95,4 @@ __all__ = [
95
95
  "ArkParseError",
96
96
  ]
97
97
 
98
- __version__ = "0.5.3"
98
+ __version__ = "0.5.4"
@@ -9,6 +9,7 @@ from __future__ import annotations
9
9
 
10
10
  import logging
11
11
  import math
12
+ import re
12
13
  import typing as t
13
14
  from dataclasses import dataclass, field
14
15
 
@@ -18,6 +19,26 @@ from .properties.registry import read_properties
18
19
 
19
20
  logger = logging.getLogger(__name__)
20
21
 
22
+ # Trailing UE actor spawn-instance suffix on cryopod class names, e.g.
23
+ # "Raptor_Character_BP_C_2145673735". ARK stores the full instance name in the
24
+ # cryopod CustomDataStrings/SoftClasses blob; the worldsave name-table path
25
+ # discards this instance int32, so non-cryo tames never carry it. Strip it to
26
+ # match the canonical class name ("Raptor_Character_BP_C") and legacy parity.
27
+ _INSTANCE_SUFFIX_RE = re.compile(r"_\d+$")
28
+
29
+
30
+ def _strip_instance_suffix(class_name: str) -> str:
31
+ """Drop a trailing ``_<digits>`` actor-instance suffix from a class name.
32
+
33
+ Pre: ``class_name`` is a str. Post: returns the same string with at most one
34
+ trailing ``_<digits>`` group removed. Legit variant suffixes (``_Aberrant_C``,
35
+ ``_Fire_C``) end in a letter, so they are never touched.
36
+ """
37
+ assert isinstance(class_name, str), "class_name must be str"
38
+ stripped = _INSTANCE_SUFFIX_RE.sub("", class_name)
39
+ assert len(stripped) <= len(class_name), "strip must not grow the string"
40
+ return stripped
41
+
21
42
 
22
43
  def _finite(value: t.Any, default: float) -> float:
23
44
  """Coerce to a finite float; NaN / inf / non-numeric collapse to ``default``.
@@ -514,7 +535,7 @@ class CryopodCreature:
514
535
  # Parse strings - need at least 3 for basic info
515
536
  strings = normalize_indexed_list(custom_data.get("CustomDataStrings"))
516
537
  if len(strings) >= 3:
517
- cryo.class_name = strings[0] # e.g., "Raptor_Character_BP_C_2145673735"
538
+ cryo.class_name = _strip_instance_suffix(strings[0]) # raw: "Raptor_Character_BP_C_2145673735"
518
539
  display_name = strings[1] # e.g., "bluey - Lvl 228 (Raptor)"
519
540
  colors_str = strings[2] # e.g., "2,2,2,2,2,2,"
520
541
 
@@ -602,7 +623,9 @@ class CryopodCreature:
602
623
  if soft_classes:
603
624
  first_class = soft_classes[0]
604
625
  if isinstance(first_class, dict):
605
- cryo.class_name = first_class.get("name", cryo.class_name)
626
+ cryo.class_name = _strip_instance_suffix(
627
+ first_class.get("name", cryo.class_name)
628
+ )
606
629
 
607
630
  # Populate raw creature_props / status_props so the export
608
631
  # pipeline's _SyntheticGameObject adapter (which calls
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arkparser
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: Pure Python parser for ARK: Survival Evolved and ARK: Survival Ascended save files
5
5
  Author: Vertyco
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "arkparser"
7
- version = "0.5.3"
7
+ version = "0.5.4"
8
8
  description = "Pure Python parser for ARK: Survival Evolved and ARK: Survival Ascended save files"
9
9
  readme = "README.md"
10
10
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes