legacy-puyo-tools 0.0.1__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.
@@ -0,0 +1,18 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ # EditorConfig is awesome: https://EditorConfig.org
6
+
7
+ # top-most EditorConfig file
8
+ root = true
9
+
10
+ [*]
11
+ indent_style = space
12
+ indent_size = 4
13
+ charset = utf-8
14
+ trim_trailing_whitespace = true
15
+ insert_final_newline = true
16
+
17
+ [*.{yaml,yml}]
18
+ indent_size = 2
@@ -0,0 +1,15 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ version: 2
6
+ updates:
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
11
+
12
+ - package-ecosystem: "uv"
13
+ directory: "/"
14
+ schedule:
15
+ interval: "weekly"
@@ -0,0 +1,35 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ name: Lint, format, and test
6
+
7
+ on:
8
+ push:
9
+ branches:
10
+ - main
11
+ pull_request:
12
+ branches:
13
+ - main
14
+
15
+ jobs:
16
+ lint:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ # Setup environment
20
+ - uses: actions/checkout@v4
21
+ - uses: astral-sh/setup-uv@v6
22
+ - uses: actions/setup-python@v5
23
+
24
+ # Disable rules about documentation and TODOs in CI
25
+ # Let the developer decide when to fix them
26
+ - name: Ruff lint
27
+ run: uv run ruff check --fix --ignore=D101,D102,FIX002
28
+ - name: Lint using pylint
29
+ run: uv run pylint src --disable=C0115,C0116,W0511
30
+
31
+ - name: Lint using pyright
32
+ run: uv run pyright
33
+
34
+ - name: Ruff format
35
+ run: uv run ruff format
@@ -0,0 +1,39 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ name: Publish to PyPI
6
+
7
+ on:
8
+ push:
9
+ tags:
10
+ - v*
11
+
12
+ jobs:
13
+ pypi:
14
+ runs-on: ubuntu-latest
15
+ environment:
16
+ name: pypi
17
+ permissions:
18
+ id-token: write
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v6
24
+ with:
25
+ enable-cache: true
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version-file: "pyproject.toml"
31
+
32
+ - name: Install package
33
+ run: uv sync --locked --all-extras --dev
34
+
35
+ - name: Build package
36
+ run: uv build
37
+
38
+ - name: Publish package
39
+ run: uv publish --trusted-publishing always
@@ -0,0 +1,225 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ .vscode/*
6
+ !.vscode/settings.json
7
+ !.vscode/tasks.json
8
+ !.vscode/launch.json
9
+ !.vscode/extensions.json
10
+ !.vscode/*.code-snippets
11
+ !*.code-workspace
12
+
13
+ # Built Visual Studio Code Extensions
14
+ *.vsix
15
+
16
+ # Byte-compiled / optimized / DLL files
17
+ __pycache__/
18
+ *.py[codz]
19
+ *$py.class
20
+
21
+ # C extensions
22
+ *.so
23
+
24
+ # Distribution / packaging
25
+ .Python
26
+ build/
27
+ develop-eggs/
28
+ dist/
29
+ downloads/
30
+ eggs/
31
+ .eggs/
32
+ lib/
33
+ lib64/
34
+ parts/
35
+ sdist/
36
+ var/
37
+ wheels/
38
+ share/python-wheels/
39
+ *.egg-info/
40
+ .installed.cfg
41
+ *.egg
42
+ MANIFEST
43
+
44
+ # PyInstaller
45
+ # Usually these files are written by a python script from a template
46
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
47
+ *.manifest
48
+ *.spec
49
+
50
+ # Installer logs
51
+ pip-log.txt
52
+ pip-delete-this-directory.txt
53
+
54
+ # Unit test / coverage reports
55
+ htmlcov/
56
+ .tox/
57
+ .nox/
58
+ .coverage
59
+ .coverage.*
60
+ .cache
61
+ nosetests.xml
62
+ coverage.xml
63
+ *.cover
64
+ *.py.cover
65
+ .hypothesis/
66
+ .pytest_cache/
67
+ cover/
68
+
69
+ # Translations
70
+ *.mo
71
+ *.pot
72
+
73
+ # Django stuff:
74
+ *.log
75
+ local_settings.py
76
+ db.sqlite3
77
+ db.sqlite3-journal
78
+
79
+ # Flask stuff:
80
+ instance/
81
+ .webassets-cache
82
+
83
+ # Scrapy stuff:
84
+ .scrapy
85
+
86
+ # Sphinx documentation
87
+ docs/_build/
88
+
89
+ # PyBuilder
90
+ .pybuilder/
91
+ target/
92
+
93
+ # Jupyter Notebook
94
+ .ipynb_checkpoints
95
+
96
+ # IPython
97
+ profile_default/
98
+ ipython_config.py
99
+
100
+ # pyenv
101
+ # For a library or package, you might want to ignore these files since the code is
102
+ # intended to run in multiple environments; otherwise, check them in:
103
+ .python-version
104
+
105
+ # pipenv
106
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
107
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
108
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
109
+ # install all needed dependencies.
110
+ #Pipfile.lock
111
+
112
+ # UV
113
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
114
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
115
+ # commonly ignored for libraries.
116
+ #uv.lock
117
+
118
+ # poetry
119
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
120
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
121
+ # commonly ignored for libraries.
122
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
123
+ #poetry.lock
124
+ #poetry.toml
125
+
126
+ # pdm
127
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
128
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
129
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
130
+ #pdm.lock
131
+ #pdm.toml
132
+ .pdm-python
133
+ .pdm-build/
134
+
135
+ # pixi
136
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
137
+ #pixi.lock
138
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
139
+ # in the .venv directory. It is recommended not to include this directory in version control.
140
+ .pixi
141
+
142
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
143
+ __pypackages__/
144
+
145
+ # Celery stuff
146
+ celerybeat-schedule
147
+ celerybeat.pid
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ #.idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
+ # you could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Cursor
213
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
214
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
215
+ # refer to https://docs.cursor.com/context/ignore-files
216
+ .cursorignore
217
+ .cursorindexingignore
218
+
219
+ # Marimo
220
+ marimo/_static/
221
+ marimo/_lsp/
222
+ __marimo__/
223
+
224
+ # Streamlit
225
+ .streamlit/secrets.toml
@@ -0,0 +1,62 @@
1
+ # SPDX-FileCopyrightText: 2024 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ # Rules from https://wushenrong.github.io/markdown-formatting-style-guide
6
+ # based on https://cirosantilli.com/markdown-style-guide/
7
+ # and https://google.github.io/styleguide/docguide/style.html
8
+
9
+ default: true
10
+
11
+ heading-style:
12
+ style: atx
13
+
14
+ ul-style:
15
+ style: dash
16
+
17
+ ul-indent:
18
+ indent: 4
19
+
20
+ no-trailing-spaces:
21
+ br_spaces: 0
22
+ strict: true
23
+
24
+ no-hard-tabs:
25
+ spaces_per_tab: 4
26
+
27
+ line-length:
28
+ heading_line_length: 120
29
+ code_block_line_length: 120
30
+ tables: false
31
+
32
+ no-duplicate-heading:
33
+ siblings_only: true
34
+
35
+ list-marker-space:
36
+ ul_multi: 3
37
+ ol_multi: 2
38
+
39
+ hr-style:
40
+ style: ---
41
+
42
+ fenced-code-language:
43
+ language_only: true
44
+
45
+ code-block-style:
46
+ style: fenced
47
+
48
+ code-fence-style:
49
+ style: backtick
50
+
51
+ emphasis-style:
52
+ style: asterisk
53
+
54
+ strong-style:
55
+ style: asterisk
56
+
57
+ link-image-style:
58
+ collapsed: false
59
+ url_inline: false
60
+
61
+ table-pipe-style:
62
+ style: no_leading_or_trailing
@@ -0,0 +1,49 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v5.0.0
8
+ hooks:
9
+ - id: check-added-large-files
10
+ - id: check-ast
11
+ - id: check-builtin-literals
12
+ - id: check-docstring-first
13
+ - id: check-illegal-windows-names
14
+ - id: check-toml
15
+ - id: check-yaml
16
+ - id: end-of-file-fixer
17
+ - id: fix-byte-order-marker
18
+ - id: mixed-line-ending
19
+ - id: trailing-whitespace
20
+
21
+ - repo: https://github.com/astral-sh/ruff-pre-commit
22
+ rev: v0.12.3
23
+ hooks:
24
+ - id: ruff-check
25
+ args:
26
+ - --fix
27
+ - id: ruff-format
28
+
29
+ - repo: https://github.com/DavidAnson/markdownlint-cli2
30
+ rev: v0.18.1
31
+ hooks:
32
+ - id: markdownlint-cli2
33
+ args:
34
+ - --fix
35
+
36
+ - repo: https://github.com/gitleaks/gitleaks
37
+ rev: v8.26.0
38
+ hooks:
39
+ - id: gitleaks
40
+
41
+ - repo: https://github.com/fsfe/reuse-tool
42
+ rev: v5.0.2
43
+ hooks:
44
+ - id: reuse
45
+
46
+ - repo: meta
47
+ hooks:
48
+ - id: check-hooks-apply
49
+ - id: check-useless-excludes
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to
7
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## 0.0.1 - 2025-07-15
10
+
11
+ ### Added
12
+
13
+ - Basic extraction support for the `mtx` format.
14
+ - Full conversion support for the `fpd` format.
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Samuel Wu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ MIT No Attribution
2
+
3
+ Copyright <YEAR> <COPYRIGHT HOLDER>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
6
+ software and associated documentation files (the "Software"), to deal in the Software
7
+ without restriction, including without limitation the rights to use, copy, modify,
8
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
12
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
13
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) <year> <copyright holders>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: legacy-puyo-tools
3
+ Version: 0.0.1
4
+ Summary: A tool to edit text for older Puyo Puyo games.
5
+ Author-email: Samuel Wu <twopizza9621536@gmail.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.13
9
+ Requires-Dist: attrs>=25.3.0
10
+ Requires-Dist: lxml>=6.0.0
11
+ Description-Content-Type: text/markdown
12
+
13
+ # Legacy Puyo Tools
14
+
15
+ Supports Puyo Puyo 7 and possibly Puyo Puyo! 15th Anniversary `mtx` and `fpd`
16
+ files. Puyo Puyo!! 20th Anniversary is still not supported yet. (Create an issue
17
+ or pull request to support `fnt` and additional `mtx` controls). Also, legacy as
18
+ in older Puyo Puyo games, not that this tool is decapitated.
19
+
20
+ ## Why
21
+
22
+ The [Puyo Text Editor][1] can already do what Legacy Puyo Tools does and is the
23
+ inspiration of this tool, but there are advantages to rewrite it in Python:
24
+
25
+ - Better cross compatibility with Linux.
26
+ - Don't have to update the language version every time it becomes End of Life.
27
+ - Avoids the rigidness of using a pure object-oriented design.
28
+
29
+ ## License
30
+
31
+ Under the MIT License. Based on [Puyo Text Editor][1] which is also under the
32
+ MIT License.
33
+
34
+ [1]: https://github.com/nickworonekin/puyo-text-editor
@@ -0,0 +1,22 @@
1
+ # Legacy Puyo Tools
2
+
3
+ Supports Puyo Puyo 7 and possibly Puyo Puyo! 15th Anniversary `mtx` and `fpd`
4
+ files. Puyo Puyo!! 20th Anniversary is still not supported yet. (Create an issue
5
+ or pull request to support `fnt` and additional `mtx` controls). Also, legacy as
6
+ in older Puyo Puyo games, not that this tool is decapitated.
7
+
8
+ ## Why
9
+
10
+ The [Puyo Text Editor][1] can already do what Legacy Puyo Tools does and is the
11
+ inspiration of this tool, but there are advantages to rewrite it in Python:
12
+
13
+ - Better cross compatibility with Linux.
14
+ - Don't have to update the language version every time it becomes End of Life.
15
+ - Avoids the rigidness of using a pure object-oriented design.
16
+
17
+ ## License
18
+
19
+ Under the MIT License. Based on [Puyo Text Editor][1] which is also under the
20
+ MIT License.
21
+
22
+ [1]: https://github.com/nickworonekin/puyo-text-editor
@@ -0,0 +1,15 @@
1
+ # SPDX-FileCopyrightText: 2025 Samuel Wu
2
+ #
3
+ # SPDX-License-Identifier: MIT-0
4
+
5
+ version = 1
6
+
7
+ [[annotations]]
8
+ SPDX-FileCopyrightText = "2025 Samuel Wu"
9
+ SPDX-License-Identifier = "MIT"
10
+ path = ["docs/formats.md"]
11
+
12
+ [[annotations]]
13
+ SPDX-FileCopyrightText = "2025 Samuel Wu"
14
+ SPDX-License-Identifier = "MIT-0"
15
+ path = ["README.md", "uv.lock"]
@@ -0,0 +1,26 @@
1
+ # Formats
2
+
3
+ Older Puyo Puyo games used multiple formats to store manzai text and character
4
+ data. This document contains how each format is structured and encoded.
5
+
6
+ ## The `fpd` format
7
+
8
+ The `fpd` format is a binary character table format used by the developers for
9
+ Puyo Puyo! 15th Anniversary and Puyo Puyo 7 to convert characters from UTF-16
10
+ little-endian into an index that is used by the `mtx` for text. Each character
11
+ entry in the `fpd` is 3 bytes long and formatted as follows: `XX XX YY`. Where
12
+ `XX XX` is the character encoded in UTF-16 little-endian and `YY` is the width
13
+ of the character. The entries are placed next to each other, creating a
14
+ zero-based index that is offset by multiples of `0x03`. I.e. the 1st character
15
+ is at index `0x00`, the 2nd character is at index `0x03`, the 3rd character is
16
+ at index `0x06`, etc.
17
+
18
+ The `fpd` is not used by the games internally except for the Nintendo DS version
19
+ of Puyo Puyo 7.
20
+
21
+ ## The `mtx` format
22
+
23
+ <!-- TODO: Finish the mtx format for PP15 and PP7 -->
24
+ <!-- TODO: Look at the mtx format for PP20 -->
25
+ The `mtx` format is a binary-encoded format used by older Puyo games for
26
+ storing character dialog and text.