Skip to content

Commit 569686a

Browse files
authored
Merge pull request #26 from Beefy-Swain/rf/caster
JSON Re-Write
2 parents 2d11951 + d215450 commit 569686a

File tree

103 files changed

+7654
-2339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+7654
-2339
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,6 @@ venv.bak/
103103
# mypy
104104
.mypy_cache/
105105
.idea/
106+
107+
# VS Code Directory
108+
.vscode

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ good-names=i,
305305
y,
306306
ex,
307307
Run,
308-
_
308+
_,
309+
id
309310

310311
# Include a hint for the correct naming format with invalid-name.
311312
include-naming-hint=no

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# PyTiled Parser
22

3-
PyTiled Parser is a Python Library for parsing
4-
[Tiled Map Editor](https://www.mapeditor.org/) (`.tmx`) files used to generate
5-
maps and levels for 2D top-down or side-scrolling games.
3+
PyTiled Parser is a Python Library for parsing JSON formatted
4+
[Tiled Map Editor](https://www.mapeditor.org/) maps and tilesets to be used as maps and levels for 2D top-down (orthogonal, hexogonal, or isometric) or side-scrolling games in a strictly typed fashion.
65

76
PyTiled Parser is not tied to any particular graphics library, and can be used
87
with [Arcade](http://arcade.academy),
98
[Pyglet](https://pyglet.readthedocs.io/en/pyglet-1.3-maintenance/),
109
[Pygame](https://www.pygame.org/news), etc.
1110

1211
* Documentation available at: https://pytiled-parser.readthedocs.io/
13-
* GitHub project at: https://github.com/pvcraven/pytiled_parser
12+
* GitHub project at: https://github.com/Beefy-Swain/pytiled_parser
1413
* PiPy: https://pypi.org/project/pytiled-parser/
1514

1615
The [Arcade](http://arcade.academy) library has
@@ -19,4 +18,10 @@ integrate PyTiled with that 2D libary, and
1918
[example code](http://arcade.academy/examples/index.html#tmx-files-tiled-map-editor) showing its use.
2019

2120
Original module by [Beefy-Swain](https://github.com/Beefy-Swain).
22-
Contributions from [pvcraven](https://github.com/pvcraven).
21+
Significant contributions from [pvcraven](https://github.com/pvcraven) and [Cleptomania](https://github.com/Cleptomania).
22+
23+
## Developement
24+
To develop pytiled parser, clone the repo, create a `venv` using a supported Python version, and activate it. Then install the package as well as all testing dependencies with the command `python -m pip install -e ".[tests]"`.
25+
26+
### Testing
27+
Run `pytest --cov=pytiled_parser` to run the test harness and report coverage.

dev_requirements.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/make.bat

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
@ECHO OFF
2-
3-
pushd %~dp0
4-
5-
REM Command file for Sphinx documentation
6-
7-
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=sphinx-build
9-
)
10-
set SOURCEDIR=source
11-
set BUILDDIR=build
12-
13-
if "%1" == "" goto help
14-
15-
%SPHINXBUILD% >NUL 2>NUL
16-
if errorlevel 9009 (
17-
echo.
18-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19-
echo.installed, then set the SPHINXBUILD environment variable to point
20-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21-
echo.may add the Sphinx directory to PATH.
22-
echo.
23-
echo.If you don't have Sphinx installed, grab it from
24-
echo.http://sphinx-doc.org/
25-
exit /b 1
26-
)
27-
28-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29-
goto end
30-
31-
:help
32-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33-
34-
:end
35-
popd
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/10_ladders_and_more.png

-58.7 KB
Binary file not shown.

docs/source/api.rst

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,59 @@
1-
.. _pytiled-api:
2-
31
PyTiled Parser API
42
==================
53

6-
This page documents the Application Programming Interface (API)
7-
for the PyTiled Parser library.
4+
pytiled\_parser.common\_types
5+
------------------------------------
6+
7+
.. automodule:: pytiled_parser.common_types
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
pytiled\_parser.layer
13+
----------------------------
14+
15+
.. automodule:: pytiled_parser.layer
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
pytiled\_parser.properties
21+
---------------------------------
22+
23+
.. automodule:: pytiled_parser.properties
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
29+
pytiled\_parser.tiled\_map
30+
---------------------------------
31+
32+
.. automodule:: pytiled_parser.tiled_map
33+
:members:
34+
:undoc-members:
35+
:show-inheritance:
36+
37+
pytiled\_parser.tiled\_object
38+
------------------------------------
39+
40+
.. automodule:: pytiled_parser.tiled_object
41+
:members:
42+
:undoc-members:
43+
:show-inheritance:
844

9-
.. automodule:: pytiled_parser.xml_parser
10-
:members:
11-
:undoc-members:
12-
:show-inheritance:
45+
pytiled\_parser.tileset
46+
------------------------------
1347

14-
.. automodule:: pytiled_parser.objects
15-
:members:
16-
:undoc-members:
17-
:show-inheritance:
48+
.. automodule:: pytiled_parser.tileset
49+
:members:
50+
:undoc-members:
51+
:show-inheritance:
1852

19-
.. automodule:: pytiled_parser.utilities
20-
:members:
21-
:undoc-members:
22-
:show-inheritance:
53+
pytiled\_parser.util
54+
---------------------------
2355

56+
.. automodule:: pytiled_parser.util
57+
:members:
58+
:undoc-members:
59+
:show-inheritance:

docs/source/conf.py

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,63 @@
22
#
33
# This file only contains a selection of the most common options. For a full
44
# list see the documentation:
5-
# http://www.sphinx-doc.org/en/master/config
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

77
# -- Path setup --------------------------------------------------------------
88

99
# If extensions (or modules to document with autodoc) are in another directory,
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13-
# import os
14-
# import sys
15-
# sys.path.insert(0, os.path.abspath('.'))
13+
import os
14+
import sys
1615

16+
sys.path.insert(0, os.path.abspath('../..'))
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
import os
21-
import sys
20+
project = 'PyTiled Parser'
21+
copyright = '2021, Beefy-Swain, Cleptomania'
22+
author = 'Beefy-Swain, Cleptomania'
2223

23-
project = "PyTiled Parser"
24-
copyright = "2019, Beefy-Swain"
25-
author = "Beefy-Swain"
24+
# The full version, including alpha/beta/rc tags
25+
release = '1.0.0'
2626

27-
sys.path.insert(0, os.path.abspath("../.."))
2827

2928
# -- General configuration ---------------------------------------------------
3029

3130
# Add any Sphinx extension module names here, as strings. They can be
3231
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3332
# ones.
3433
extensions = [
35-
"sphinx.ext.autodoc",
36-
"sphinx.ext.intersphinx",
37-
"sphinx.ext.todo",
38-
"sphinx.ext.coverage",
39-
"sphinx.ext.ifconfig",
40-
"sphinx.ext.viewcode",
34+
'sphinx.ext.autodoc',
35+
'sphinx.ext.coverage',
36+
'sphinx.ext.viewcode',
37+
'sphinx.ext.napoleon',
4138
]
4239

4340
# Add any paths that contain templates here, relative to this directory.
44-
templates_path = ["_templates"]
45-
46-
source_suffix = ".rst"
47-
48-
master_doc = "index"
49-
50-
pygments_style = "sphinx"
41+
templates_path = ['_templates']
5142

5243
# List of patterns, relative to source directory, that match files and
5344
# directories to ignore when looking for source files.
5445
# This pattern also affects html_static_path and html_extra_path.
5546
exclude_patterns = []
5647

48+
source_suffix = '.rst'
49+
50+
master_doc = 'index'
51+
52+
pygments_style = 'sphinx'
5753

5854
# -- Options for HTML output -------------------------------------------------
5955

6056
# The theme to use for HTML and HTML Help pages. See the documentation for
6157
# a list of builtin themes.
6258
#
63-
html_theme = "sphinx_rtd_theme"
59+
html_theme = 'sphinx_rtd_theme'
6460

6561
# Add any paths that contain custom static files (such as style sheets) here,
6662
# relative to this directory. They are copied after the builtin static files,
6763
# so a file named "default.css" will overwrite the builtin "default.css".
68-
html_static_path = ["_static"]
64+
html_static_path = ['_static']

docs/source/index.rst

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
11
PyTiled Parser
22
==============
33

4-
.. image:: 10_ladders_and_more.png
5-
:width: 50%
4+
PyTiled Parser is a Python library for parsing `Tiled Map Editor`_ (`.json`) files used to generate maps and levels for 2D games.
65

7-
PyTiled Parser is a Python Library for parsing
8-
`Tiled Map Editor`_ (`.tmx`) files used to generate
9-
maps and levels for 2D top-down or side-scrolling games.
6+
PyTiled Parser is not tied to any particular graphics library, and can be used with Arcade_, Pyglet_, Pygame_, and more.
107

11-
PyTiled Parser is not tied to any particular graphics library, and can be used
12-
with Arcade_, Pyglet_, Pygame_, and more.
13-
14-
API Documentation
8+
API documentation
159
-----------------
1610

1711
.. toctree::
1812
:maxdepth: 2
1913

2014
api
2115

22-
Examples
23-
--------
24-
25-
* `Games using the Arcade library <http://arcade.academy/examples/index.html#tmx-files-tiled-map-editor>`_
26-
27-
.. _Tiled Map Editor: https://www.mapeditor.org/
28-
.. _Arcade: http://arcade.academy
29-
.. _Pyglet: https://pyglet.readthedocs.io/en/pyglet-1.3-maintenance/
30-
.. _Pygame: https://www.pygame.org/news
31-
3216
For More Info
3317
-------------
3418

35-
* `PyTiled Parser on GitHub <https://github.com/pvcraven/pytiled_parser>`_
36-
* `PyTiled Parser on PyPi <https://pypi.org/project/pytiled-parser/>`_
19+
* `PyTiled Parser on Github <https://github.com/beefy-swain/pytiled_parser>`_
20+
* `PyTiled Parser on PyPi <https://pypi.org/project/pytiled-parser/>`_

0 commit comments

Comments
 (0)