PyLibMS 2.0.6__tar.gz → 2.0.8__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 (67) hide show
  1. {pylibms-2.0.6/LMS → pylibms-2.0.8/LMS/Message/Definitions}/Field/LMS_Field.py +3 -3
  2. {pylibms-2.0.6/LMS/Message/Definitions → pylibms-2.0.8/LMS/Message/Definitions/Field}/LMS_FieldMap.py +1 -1
  3. {pylibms-2.0.6/LMS → pylibms-2.0.8/LMS/Message/Definitions}/Field/Stream.py +2 -2
  4. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Definitions/LMS_MessageText.py +3 -2
  5. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/MSBT.py +41 -3
  6. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/MSBTEntry.py +1 -1
  7. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/MSBTStream.py +5 -12
  8. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Section/ATR1.py +4 -4
  9. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Tag/LMS_Tag.py +4 -3
  10. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Tag/Stream.py +6 -8
  11. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Tag/System_Definition.py +1 -1
  12. pylibms-2.0.8/LMS/Message/Tag/Tag_Formats.py +10 -0
  13. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Definitions/Attribute.py +1 -1
  14. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Definitions/Tag.py +1 -1
  15. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/MSBPRead.py +1 -1
  16. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/ATI2.py +1 -1
  17. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/TAG2.py +1 -1
  18. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/TGP2.py +1 -1
  19. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Config.py +1 -1
  20. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Definitions/Value.py +1 -1
  21. {pylibms-2.0.6 → pylibms-2.0.8}/PKG-INFO +32 -3
  22. {pylibms-2.0.6 → pylibms-2.0.8}/PyLibMS.egg-info/PKG-INFO +32 -3
  23. {pylibms-2.0.6 → pylibms-2.0.8}/PyLibMS.egg-info/SOURCES.txt +5 -5
  24. pylibms-2.0.8/README.md +44 -0
  25. {pylibms-2.0.6 → pylibms-2.0.8}/pyproject.toml +1 -1
  26. pylibms-2.0.6/LMS/Message/Tag/Tag_Formats.py +0 -10
  27. pylibms-2.0.6/README.md +0 -15
  28. {pylibms-2.0.6 → pylibms-2.0.8}/LICENSE +0 -0
  29. {pylibms-2.0.6/LMS/Field → pylibms-2.0.8/LMS/Common}/LMS_DataType.py +0 -0
  30. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Common/LMS_Exceptions.py +0 -0
  31. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Common/LMS_FileInfo.py +0 -0
  32. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Common/Stream/FileInfo.py +0 -0
  33. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Common/Stream/Hashtable.py +0 -0
  34. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Common/Stream/Section.py +0 -0
  35. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Common/__init__.py +0 -0
  36. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/FileIO/Encoding.py +0 -0
  37. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/FileIO/Stream.py +0 -0
  38. {pylibms-2.0.6/LMS → pylibms-2.0.8/LMS/Message/Definitions}/Field/__init__.py +0 -0
  39. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Definitions/__init__.py +0 -0
  40. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Section/TSY1.py +0 -0
  41. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Section/TXT2.py +0 -0
  42. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Section/__init__.py +0 -0
  43. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Tag/LMS_TagExceptions.py +0 -0
  44. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/Tag/__init__.py +0 -0
  45. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Message/__init__.py +0 -0
  46. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Definitions/Color.py +0 -0
  47. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Definitions/Style.py +0 -0
  48. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Definitions/__init__.py +0 -0
  49. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/MSBP.py +0 -0
  50. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/ALI2.py +0 -0
  51. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/CLR1.py +0 -0
  52. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/SYL3.py +0 -0
  53. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/String.py +0 -0
  54. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/Section/TGG2.py +0 -0
  55. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/Project/__init__.py +0 -0
  56. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Definitions/Attributes.py +0 -0
  57. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Definitions/Tags.py +0 -0
  58. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Definitions/__init__.py +0 -0
  59. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Presets/Tomodachi Life.yaml +0 -0
  60. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/Presets/__init__.py +0 -0
  61. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/TitleConfig/__init__.py +0 -0
  62. {pylibms-2.0.6 → pylibms-2.0.8}/LMS/__init__.py +0 -0
  63. {pylibms-2.0.6 → pylibms-2.0.8}/MANIFEST.in +0 -0
  64. {pylibms-2.0.6 → pylibms-2.0.8}/PyLibMS.egg-info/dependency_links.txt +0 -0
  65. {pylibms-2.0.6 → pylibms-2.0.8}/PyLibMS.egg-info/requires.txt +0 -0
  66. {pylibms-2.0.6 → pylibms-2.0.8}/PyLibMS.egg-info/top_level.txt +0 -0
  67. {pylibms-2.0.6 → pylibms-2.0.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass, field
2
2
 
3
- from LMS.Field.LMS_DataType import LMS_DataType
3
+ from LMS.Common.LMS_DataType import LMS_DataType
4
4
  from LMS.TitleConfig.Definitions.Value import ValueDefinition
5
5
 
6
6
 
@@ -23,8 +23,8 @@ class LMS_Field:
23
23
  preview = self.list_items[:3] + ["..."]
24
24
  else:
25
25
  preview = self.list_items
26
- return f"LMS_Value(value={self._value}, options={preview})"
27
- return f"LMS_Value(value={self._value!r}, type={typename})"
26
+ return f"LMS_Field(value={self._value}, options={preview})"
27
+ return f"LMS_Field(value={self._value!r}, type={typename})"
28
28
 
29
29
  @property
30
30
  def name(self) -> str:
@@ -1,4 +1,4 @@
1
- from LMS.Field.LMS_Field import LMS_Field
1
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_Field
2
2
 
3
3
  # Typehint that represents a map of strings to field instances.
4
4
  # Utilized as a means of storing attributes, or parameters in decoded tags mapped to their string names.
@@ -1,6 +1,6 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
2
- from LMS.Field.LMS_Field import LMS_Field
1
+ from LMS.Common.LMS_DataType import LMS_DataType
3
2
  from LMS.FileIO.Stream import FileReader, FileWriter
3
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_Field
4
4
  from LMS.TitleConfig.Definitions.Value import ValueDefinition
5
5
 
6
6
 
@@ -1,9 +1,10 @@
1
1
  import re
2
2
  from typing import overload
3
3
 
4
- from LMS.Field.LMS_Field import LMS_Field
4
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_Field
5
5
  from LMS.Message.Tag.LMS_Tag import LMS_DecodedTag, LMS_EncodedTag, LMS_TagBase
6
- from LMS.Message.Tag.Tag_Formats import DECODED_FORMAT, ENCODED_FORMAT, TAG_FORMAT
6
+ from LMS.Message.Tag.Tag_Formats import (DECODED_FORMAT, ENCODED_FORMAT,
7
+ TAG_FORMAT)
7
8
  from LMS.TitleConfig.Config import TagConfig
8
9
 
9
10
 
@@ -1,5 +1,9 @@
1
1
  from LMS.Common.LMS_FileInfo import LMS_FileInfo
2
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_Field
3
+ from LMS.Message.Definitions.LMS_MessageText import LMS_MessageText
2
4
  from LMS.Message.MSBTEntry import MSBTEntry
5
+ from LMS.TitleConfig.Definitions.Attributes import AttributeConfig
6
+ from LMS.TitleConfig.Definitions.Tags import TagConfig
3
7
 
4
8
 
5
9
  class MSBT:
@@ -7,7 +11,12 @@ class MSBT:
7
11
 
8
12
  https://nintendo-formats.com/libs/lms/msbt.html."""
9
13
 
10
- def __init__(self, info: LMS_FileInfo):
14
+ def __init__(
15
+ self,
16
+ info: LMS_FileInfo,
17
+ attribute_config: AttributeConfig | None,
18
+ tag_config: TagConfig | None,
19
+ ):
11
20
  self._info = info
12
21
 
13
22
  self._entries: list[MSBTEntry] = []
@@ -27,6 +36,10 @@ class MSBT:
27
36
  # List of unsupported sections mapped to their raw data
28
37
  self.unsupported_sections: dict[str, bytes] = {}
29
38
 
39
+ # Store configs so if new labels are added LMS_MessageText objects and Attributes can be made properly
40
+ self._attribute_config = attribute_config
41
+ self._tag_config = tag_config
42
+
30
43
  @property
31
44
  def info(self) -> LMS_FileInfo:
32
45
  """The file info for the MSBT instance."""
@@ -41,7 +54,7 @@ class MSBT:
41
54
  self,
42
55
  name: str,
43
56
  text: str = None,
44
- attribute: dict[str, int | str | float | bool | bytes] = None,
57
+ attribute: dict[str, int | str | float | bool | bytes] | bytes = None,
45
58
  style_index: int = None,
46
59
  ) -> None:
47
60
  """Adds an entry to the MSBT instance.
@@ -50,7 +63,32 @@ class MSBT:
50
63
  if name in [entry.name for entry in self.entries]:
51
64
  raise KeyError(f"The label '{name}' already exists!")
52
65
 
53
- self._entries.append(MSBTEntry(name, text, attribute, style_index))
66
+ if isinstance(attribute, dict):
67
+ if self._attribute_config is None:
68
+ raise ValueError(
69
+ "The attribute config must have been provided when reading to add decoded attributes!"
70
+ )
71
+
72
+ converted_attribute = {}
73
+
74
+ for definition in self._attribute_config.definitions:
75
+ converted_attribute[definition.name] = LMS_Field(
76
+ attribute[definition.name], definition
77
+ )
78
+ else:
79
+ converted_attribute = attribute
80
+
81
+ if text is not None:
82
+ if self._tag_config is not None:
83
+ message_text = LMS_MessageText(text, self._tag_config)
84
+ else:
85
+ message_text = text
86
+ else:
87
+ message_text = ""
88
+
89
+ self._entries.append(
90
+ MSBTEntry(name, message_text, converted_attribute, style_index)
91
+ )
54
92
 
55
93
  def get_entry(self, name: str) -> MSBTEntry:
56
94
  """Retrieves an entry given it's name.
@@ -1,4 +1,4 @@
1
- from LMS.Message.Definitions.LMS_FieldMap import LMS_FieldMap
1
+ from LMS.Message.Definitions.Field.LMS_FieldMap import LMS_FieldMap
2
2
  from LMS.Message.Definitions.LMS_MessageText import LMS_MessageText
3
3
 
4
4
 
@@ -3,20 +3,13 @@ from typing import BinaryIO
3
3
  from LMS.Common import LMS_Exceptions
4
4
  from LMS.Common.Stream.FileInfo import read_file_info, write_file_info
5
5
  from LMS.Common.Stream.Hashtable import read_labels, write_labels
6
- from LMS.Common.Stream.Section import (
7
- read_section_data,
8
- write_section,
9
- write_unsupported_section,
10
- )
6
+ from LMS.Common.Stream.Section import (read_section_data, write_section,
7
+ write_unsupported_section)
11
8
  from LMS.FileIO.Stream import FileReader, FileWriter
12
9
  from LMS.Message.MSBT import MSBT
13
10
  from LMS.Message.MSBTEntry import MSBTEntry
14
- from LMS.Message.Section.ATR1 import (
15
- read_decoded_atr1,
16
- read_encoded_atr1,
17
- write_decoded_atr1,
18
- write_encoded_atr1,
19
- )
11
+ from LMS.Message.Section.ATR1 import (read_decoded_atr1, read_encoded_atr1,
12
+ write_decoded_atr1, write_encoded_atr1)
20
13
  from LMS.Message.Section.TSY1 import read_tsy1, write_tsy1
21
14
  from LMS.Message.Section.TXT2 import read_txt2, write_txt2
22
15
  from LMS.TitleConfig.Config import AttributeConfig, TagConfig
@@ -43,7 +36,7 @@ def read_msbt(
43
36
  reader = FileReader(stream)
44
37
  file_info = read_file_info(reader, "MsgStdBn")
45
38
 
46
- file = MSBT(file_info)
39
+ file = MSBT(file_info, attribute_config, tag_config)
47
40
 
48
41
  if attribute_config is not None:
49
42
  file.encoded_attributes = False
@@ -1,8 +1,8 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
2
- from LMS.Field.LMS_Field import LMS_DataType, LMS_Field
3
- from LMS.Field.Stream import read_field, write_field
1
+ from LMS.Common.LMS_DataType import LMS_DataType
4
2
  from LMS.FileIO.Stream import FileReader, FileWriter
5
- from LMS.Message.Definitions.LMS_FieldMap import LMS_FieldMap
3
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_DataType, LMS_Field
4
+ from LMS.Message.Definitions.Field.LMS_FieldMap import LMS_FieldMap
5
+ from LMS.Message.Definitions.Field.Stream import read_field, write_field
6
6
  from LMS.TitleConfig.Definitions.Attributes import AttributeConfig
7
7
 
8
8
 
@@ -1,10 +1,11 @@
1
1
  import re
2
2
  from abc import ABC, abstractmethod
3
3
 
4
- from LMS.Field.LMS_Field import LMS_Field, cast_value
5
- from LMS.Message.Definitions.LMS_FieldMap import LMS_FieldMap
4
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_Field, cast_value
5
+ from LMS.Message.Definitions.Field.LMS_FieldMap import LMS_FieldMap
6
6
  from LMS.Message.Tag.LMS_TagExceptions import LMS_InvalidTagFormatError
7
- from LMS.Message.Tag.Tag_Formats import DECODED_FORMAT, ENCODED_FORMAT, PARAMETER_FORMAT
7
+ from LMS.Message.Tag.Tag_Formats import (DECODED_FORMAT, ENCODED_FORMAT,
8
+ PARAMETER_FORMAT)
8
9
  from LMS.TitleConfig.Definitions.Tags import TagConfig
9
10
 
10
11
 
@@ -1,13 +1,11 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
2
- from LMS.Field.LMS_Field import LMS_Field
3
- from LMS.Field.Stream import read_field, write_field
1
+ from LMS.Common.LMS_DataType import LMS_DataType
4
2
  from LMS.FileIO.Stream import FileReader, FileWriter
5
- from LMS.Message.Definitions.LMS_FieldMap import LMS_FieldMap
3
+ from LMS.Message.Definitions.Field.LMS_Field import LMS_Field
4
+ from LMS.Message.Definitions.Field.LMS_FieldMap import LMS_FieldMap
5
+ from LMS.Message.Definitions.Field.Stream import read_field, write_field
6
6
  from LMS.Message.Tag.LMS_Tag import LMS_DecodedTag, LMS_EncodedTag, LMS_TagBase
7
- from LMS.Message.Tag.LMS_TagExceptions import (
8
- LMS_TagReadingError,
9
- LMS_TagWritingException,
10
- )
7
+ from LMS.Message.Tag.LMS_TagExceptions import (LMS_TagReadingError,
8
+ LMS_TagWritingException)
11
9
  from LMS.Message.Tag.System_Definition import SYSTEM_GROUP
12
10
  from LMS.TitleConfig.Definitions.Tags import TagConfig, TagDefinition
13
11
 
@@ -1,4 +1,4 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
1
+ from LMS.Common.LMS_DataType import LMS_DataType
2
2
  from LMS.TitleConfig.Definitions.Tags import TagDefinition
3
3
  from LMS.TitleConfig.Definitions.Value import ValueDefinition
4
4
 
@@ -0,0 +1,10 @@
1
+ # Regex formats for control tags
2
+
3
+ # Regular format for any tag
4
+ TAG_FORMAT = r"(\[[^\]]+\])"
5
+
6
+ DECODED_FORMAT = r"\[(\w+):(\w+)(.*?)\]"
7
+ ENCODED_FORMAT = r"\[([A-Za-z0-9]+):([A-Za-z0-9]+)\s?([0-9A-Fa-f\-]*)?\]"
8
+
9
+ # Key value pair regex for decoded tags
10
+ PARAMETER_FORMAT = r'(\w+)="([^"]*)"'
@@ -1,4 +1,4 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
1
+ from LMS.Common.LMS_DataType import LMS_DataType
2
2
 
3
3
 
4
4
  class LMS_AttributeInfo:
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from LMS.Field.LMS_DataType import LMS_DataType
3
+ from LMS.Common.LMS_DataType import LMS_DataType
4
4
 
5
5
 
6
6
  class LMS_TagGroup:
@@ -1,10 +1,10 @@
1
1
  import os
2
2
  from typing import BinaryIO
3
3
 
4
+ from LMS.Common.LMS_DataType import LMS_DataType
4
5
  from LMS.Common.Stream.FileInfo import read_file_info
5
6
  from LMS.Common.Stream.Hashtable import read_labels
6
7
  from LMS.Common.Stream.Section import read_section_data
7
- from LMS.Field.LMS_DataType import LMS_DataType
8
8
  from LMS.FileIO.Stream import FileReader
9
9
  from LMS.Project.MSBP import MSBP
10
10
  from LMS.Project.Section.ALI2 import read_ali2
@@ -1,4 +1,4 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
1
+ from LMS.Common.LMS_DataType import LMS_DataType
2
2
  from LMS.FileIO.Stream import FileReader
3
3
  from LMS.Project.Definitions.Attribute import LMS_AttributeInfo
4
4
 
@@ -1,4 +1,4 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
1
+ from LMS.Common.LMS_DataType import LMS_DataType
2
2
  from LMS.FileIO.Stream import FileReader
3
3
  from LMS.Project.Definitions.Tag import LMS_TagInfo
4
4
 
@@ -1,4 +1,4 @@
1
- from LMS.Field.LMS_DataType import LMS_DataType
1
+ from LMS.Common.LMS_DataType import LMS_DataType
2
2
  from LMS.FileIO.Stream import FileReader
3
3
  from LMS.Project.Definitions.Tag import LMS_TagParamInfo
4
4
 
@@ -3,7 +3,7 @@ from typing import Self
3
3
 
4
4
  import yaml
5
5
 
6
- from LMS.Field.LMS_DataType import LMS_DataType
6
+ from LMS.Common.LMS_DataType import LMS_DataType
7
7
  from LMS.Project.MSBP import MSBP
8
8
  from LMS.TitleConfig.Definitions.Attributes import AttributeConfig
9
9
  from LMS.TitleConfig.Definitions.Tags import TagConfig, TagDefinition
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass, field
2
2
 
3
- from LMS.Field.LMS_DataType import LMS_DataType
3
+ from LMS.Common.LMS_DataType import LMS_DataType
4
4
 
5
5
 
6
6
  @dataclass(frozen=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyLibMS
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF.
5
5
  Author: AbdyyEee
6
6
  License: Copyright 2025 AbdyyEee
@@ -20,7 +20,14 @@ Requires-Dist: PyYAML==6.0.1
20
20
  Dynamic: license-file
21
21
 
22
22
  # PylibMS
23
- Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF. Games that work with the library, including but not limited to:
23
+ Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports the following:
24
+
25
+ * Full reading and writing of MSBT files.
26
+ * Full reading of MSBP files.
27
+ * Supports encoded/decoded attributes and encoding/decoded tags.
28
+ * Additonal tag manipulation.
29
+
30
+ Games that work with the library, including but not limited to:
24
31
  * Tomodachi Life
25
32
  * Nintendo Badge Arcade
26
33
  * The Legend of Zelda: A Link Between Worlds
@@ -28,9 +35,31 @@ Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary f
28
35
  * Super Mario 3D World
29
36
  * Super Mario 3D Land.
30
37
  # Features and Usage
31
- See [the wiki](https://github.com/AbdyyEee/PylibMS/wiki) for explanations and examples on how to use the library.
38
+ Simple preview of the library is below. See [the wiki](https://github.com/AbdyyEee/PylibMS/wiki) for more explanations and examples.
39
+ ## Reading
40
+ MSBT
41
+ ```py
42
+ from LMS.Message.MSBTStream import read_msbt
43
+
44
+ with open("Game.msbt", "rb+") as f:
45
+ msbt = read_msbt(f)
46
+ ```
47
+ ## Writing
48
+ ```py
49
+ from LMS.Message.MSBTStream import write_msbt
50
+
51
+ with open("Out.msbt", "wb") as f:
52
+ write_msbt(f, msbt)
53
+ ```
54
+ # Adding Presets
55
+ To add a Preset, you may create an issue with the relevant yaml file and the game it is for.
56
+
32
57
  # Installation
33
58
  ```
34
59
  pip install PylibMS
35
60
  ```
36
61
  Python version must be `>=3.10.`
62
+ # Credits & Sources
63
+ * [Nintendo-File-Formats](nintendo-formats.com) by Kinnay: For existing information on the MSBT and MSBP file formats.
64
+ * [Trippixyz](https://github.com/Trippixyz): For helping me get started general decompilation of the formats and general help.
65
+ * [AeonSake](https://github.com/AeonSake): Inspiration for some the implementation of the library and a bit of general help.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyLibMS
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF.
5
5
  Author: AbdyyEee
6
6
  License: Copyright 2025 AbdyyEee
@@ -20,7 +20,14 @@ Requires-Dist: PyYAML==6.0.1
20
20
  Dynamic: license-file
21
21
 
22
22
  # PylibMS
23
- Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF. Games that work with the library, including but not limited to:
23
+ Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports the following:
24
+
25
+ * Full reading and writing of MSBT files.
26
+ * Full reading of MSBP files.
27
+ * Supports encoded/decoded attributes and encoding/decoded tags.
28
+ * Additonal tag manipulation.
29
+
30
+ Games that work with the library, including but not limited to:
24
31
  * Tomodachi Life
25
32
  * Nintendo Badge Arcade
26
33
  * The Legend of Zelda: A Link Between Worlds
@@ -28,9 +35,31 @@ Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary f
28
35
  * Super Mario 3D World
29
36
  * Super Mario 3D Land.
30
37
  # Features and Usage
31
- See [the wiki](https://github.com/AbdyyEee/PylibMS/wiki) for explanations and examples on how to use the library.
38
+ Simple preview of the library is below. See [the wiki](https://github.com/AbdyyEee/PylibMS/wiki) for more explanations and examples.
39
+ ## Reading
40
+ MSBT
41
+ ```py
42
+ from LMS.Message.MSBTStream import read_msbt
43
+
44
+ with open("Game.msbt", "rb+") as f:
45
+ msbt = read_msbt(f)
46
+ ```
47
+ ## Writing
48
+ ```py
49
+ from LMS.Message.MSBTStream import write_msbt
50
+
51
+ with open("Out.msbt", "wb") as f:
52
+ write_msbt(f, msbt)
53
+ ```
54
+ # Adding Presets
55
+ To add a Preset, you may create an issue with the relevant yaml file and the game it is for.
56
+
32
57
  # Installation
33
58
  ```
34
59
  pip install PylibMS
35
60
  ```
36
61
  Python version must be `>=3.10.`
62
+ # Credits & Sources
63
+ * [Nintendo-File-Formats](nintendo-formats.com) by Kinnay: For existing information on the MSBT and MSBP file formats.
64
+ * [Trippixyz](https://github.com/Trippixyz): For helping me get started general decompilation of the formats and general help.
65
+ * [AeonSake](https://github.com/AeonSake): Inspiration for some the implementation of the library and a bit of general help.
@@ -3,25 +3,25 @@ MANIFEST.in
3
3
  README.md
4
4
  pyproject.toml
5
5
  LMS/__init__.py
6
+ LMS/Common/LMS_DataType.py
6
7
  LMS/Common/LMS_Exceptions.py
7
8
  LMS/Common/LMS_FileInfo.py
8
9
  LMS/Common/__init__.py
9
10
  LMS/Common/Stream/FileInfo.py
10
11
  LMS/Common/Stream/Hashtable.py
11
12
  LMS/Common/Stream/Section.py
12
- LMS/Field/LMS_DataType.py
13
- LMS/Field/LMS_Field.py
14
- LMS/Field/Stream.py
15
- LMS/Field/__init__.py
16
13
  LMS/FileIO/Encoding.py
17
14
  LMS/FileIO/Stream.py
18
15
  LMS/Message/MSBT.py
19
16
  LMS/Message/MSBTEntry.py
20
17
  LMS/Message/MSBTStream.py
21
18
  LMS/Message/__init__.py
22
- LMS/Message/Definitions/LMS_FieldMap.py
23
19
  LMS/Message/Definitions/LMS_MessageText.py
24
20
  LMS/Message/Definitions/__init__.py
21
+ LMS/Message/Definitions/Field/LMS_Field.py
22
+ LMS/Message/Definitions/Field/LMS_FieldMap.py
23
+ LMS/Message/Definitions/Field/Stream.py
24
+ LMS/Message/Definitions/Field/__init__.py
25
25
  LMS/Message/Section/ATR1.py
26
26
  LMS/Message/Section/TSY1.py
27
27
  LMS/Message/Section/TXT2.py
@@ -0,0 +1,44 @@
1
+ # PylibMS
2
+ Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports the following:
3
+
4
+ * Full reading and writing of MSBT files.
5
+ * Full reading of MSBP files.
6
+ * Supports encoded/decoded attributes and encoding/decoded tags.
7
+ * Additonal tag manipulation.
8
+
9
+ Games that work with the library, including but not limited to:
10
+ * Tomodachi Life
11
+ * Nintendo Badge Arcade
12
+ * The Legend of Zelda: A Link Between Worlds
13
+ * Animal Crossing: Amiibo Festival
14
+ * Super Mario 3D World
15
+ * Super Mario 3D Land.
16
+ # Features and Usage
17
+ Simple preview of the library is below. See [the wiki](https://github.com/AbdyyEee/PylibMS/wiki) for more explanations and examples.
18
+ ## Reading
19
+ MSBT
20
+ ```py
21
+ from LMS.Message.MSBTStream import read_msbt
22
+
23
+ with open("Game.msbt", "rb+") as f:
24
+ msbt = read_msbt(f)
25
+ ```
26
+ ## Writing
27
+ ```py
28
+ from LMS.Message.MSBTStream import write_msbt
29
+
30
+ with open("Out.msbt", "wb") as f:
31
+ write_msbt(f, msbt)
32
+ ```
33
+ # Adding Presets
34
+ To add a Preset, you may create an issue with the relevant yaml file and the game it is for.
35
+
36
+ # Installation
37
+ ```
38
+ pip install PylibMS
39
+ ```
40
+ Python version must be `>=3.10.`
41
+ # Credits & Sources
42
+ * [Nintendo-File-Formats](nintendo-formats.com) by Kinnay: For existing information on the MSBT and MSBP file formats.
43
+ * [Trippixyz](https://github.com/Trippixyz): For helping me get started general decompilation of the formats and general help.
44
+ * [AeonSake](https://github.com/AeonSake): Inspiration for some the implementation of the library and a bit of general help.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyLibMS"
7
- version = "2.0.6"
7
+ version = "2.0.8"
8
8
  requires-python = ">=3.10"
9
9
  description = "Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF."
10
10
  readme = "README.md"
@@ -1,10 +0,0 @@
1
- # Regex formats for control tags
2
-
3
- # Regular format for any tag
4
- TAG_FORMAT = r"^\[[^\]]+\]$"
5
-
6
- DECODED_FORMAT = r"^\[(\w+):(\w+)(.*?)\]$"
7
- ENCODED_FORMAT = r"^\[([A-Za-z0-9]+):([A-Za-z0-9]+)\s?([0-9A-Fa-f\-]*)?\]$"
8
-
9
- # Key value pair regex for decoded tags
10
- PARAMETER_FORMAT = r'(\w+)="([^"]*)"'
pylibms-2.0.6/README.md DELETED
@@ -1,15 +0,0 @@
1
- # PylibMS
2
- Python library built in Python 3.10+ or the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF. Games that work with the library, including but not limited to:
3
- * Tomodachi Life
4
- * Nintendo Badge Arcade
5
- * The Legend of Zelda: A Link Between Worlds
6
- * Animal Crossing: Amiibo Festival
7
- * Super Mario 3D World
8
- * Super Mario 3D Land.
9
- # Features and Usage
10
- See [the wiki](https://github.com/AbdyyEee/PylibMS/wiki) for explanations and examples on how to use the library.
11
- # Installation
12
- ```
13
- pip install PylibMS
14
- ```
15
- Python version must be `>=3.10.`
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes