{"id":18383246,"url":"https://github.com/pythonarcade/pytiled_parser","last_synced_at":"2025-04-05T01:04:15.510Z","repository":{"id":41813180,"uuid":"183971830","full_name":"pythonarcade/pytiled_parser","owner":"pythonarcade","description":"Python Library for parsing Tiled Map Editor maps.","archived":false,"fork":false,"pushed_at":"2025-01-23T18:42:46.000Z","size":759,"stargazers_count":34,"open_issues_count":9,"forks_count":21,"subscribers_count":4,"default_branch":"development","last_synced_at":"2025-03-29T00:04:47.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pythonarcade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-29T00:00:29.000Z","updated_at":"2025-03-19T15:48:45.000Z","dependencies_parsed_at":"2024-06-18T14:01:56.912Z","dependency_job_id":"a4d8e678-b7c9-4ea9-b443-e20246c3c099","html_url":"https://github.com/pythonarcade/pytiled_parser","commit_stats":{"total_commits":408,"total_committers":19,"mean_commits":"21.473684210526315","dds":0.5882352941176471,"last_synced_commit":"248050ce7466f8405177f76ed79ae58b0f304bd3"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonarcade%2Fpytiled_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonarcade%2Fpytiled_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonarcade%2Fpytiled_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonarcade%2Fpytiled_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythonarcade","download_url":"https://codeload.github.com/pythonarcade/pytiled_parser/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271517,"owners_count":20911587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:10:35.945Z","updated_at":"2025-04-05T01:04:15.475Z","avatar_url":"https://github.com/pythonarcade.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytiled-parser\n\nPyTiled Parser is a Python Library for parsing [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.\n\nPyTiled Parser is not tied to any particular graphics library or game engine. It parses map files and returns arbitrary Python types(like `Path` objects for image files rather than a `Sprite` from any particular engine). This means it can be used to aide in implementing Tiled support into a wide variety of tools.\n\n- Documentation available at: https://pytiled-parser.readthedocs.io/\n- GitHub project at: https://github.com/pythonarcade/pytiled_parser\n- PyPi: https://pypi.org/project/pytiled-parser/\n\nThe [Arcade](https://api.arcade.academy) library has\n[supporting code](https://api.arcade.academy/en/latest/api/tilemap.html) to\nintegrate PyTiled Parser and [example code](https://api.arcade.academy/en/latest/examples/index.html#using-tiled-map-editor-to-create-maps) showing its use.\n\n## Supported Python Versions\n\npytiled-parser works on Python 3.6 - 3.13(and should continue to work on new versions). However we are not actively testing on Python 3.6 and 3.7 due to other development tooling not supporting them, however as long as it remains tenable to do so, we will support these versions and fix problems for them.\n\n## Installation\n\nSimply install with pip:\n\n```\npip install pytiled-parser\n```\n\n## Loading a Map\n\n**NOTE:** All map paths should ideally be `Path` objects from Python's `pathlib` module. However a string will work in many cases.\n\n```python\nfrom pathlib import Path\n\nimport pytiled_parser\n\nmap_file = Path(\"assets/maps/my_map.tmx\")\nmy_map = pytiled_parser.parse_map(map_file)\n```\n\nIn order to fully understand the pytiled-parser API, it is suggested that you have a solid understanding of the [Tiled Map Editor](https://doc.mapeditor.org/en/stable/), and it's [JSON format](https://doc.mapeditor.org/en/stable/reference/json-map-format/). An effort was made to keep the API that pytiled-parser provides as close as possible with the JSON format directly. Only small variations are made at certain points for ease of use with integrating to a game or engine.\n\n## Working With Layers\n\nLayers are loaded as an ordered list of `Layer` objects within the map. They can be accessed via the `layers` attribute of a map. There has been debate about wether or not these should be loaded in as a Dictionary, with the keys being the name of the layer. The decision was ultimately made to leave them as a list, as there is no guarantee, and beyond that is considered acceptable use to have duplicate layer names in Tiled.\n\nThus the decision to allow duplicate layer names is up to the implementation, as an example, [Arcade](https://arcade.academy) does not allow duplicate layer names, as it re-roganizes layers into dictionaries based on the name.\n\n## Development\n\nTo 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, linting, and formatting dependencies with the command `python -m pip install -e \".[dev]\"`.\n\n### Linting and Formatting\n\nflake8, mypy, black, and isort should all be used during development. These should ideally all pass before committing. Some work is under way to have a pre-commit hook for these or do checks in CI.\n\n### Testing\n\nRun `pytest --cov=pytiled_parser` to run the test harness and report coverage.\n\n### Docs\n\nInstall Docs dependencies with the command `python -m pip install \".[docs]\"`\n\nTo serve the docs locally:\n\n```\nmkdocs serve\n```\n\nThey can then be accessed on http://localhost:8000\n\n## Credits\n\nOriginal module created by [Benjamin Kirkbride](https://github.com/benjamin-kirkbride).\n\nCurrently maintained by [Cleptomania](https://github.com/cleptomania)\n\nSpecial thanks for contributions from [pvcraven](https://github.com/pvcraven) and the contributors that create Tiled, without which this library wouldn't exist.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonarcade%2Fpytiled_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythonarcade%2Fpytiled_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonarcade%2Fpytiled_parser/lists"}