tmxlib: the Python tilemap toolkit

tmxlib is a Python library fo handling TMX tile maps. It serves a relatively specific purpose: making it easy to write scripts for automatic handling of TMX files.

If you aren’t familiar with TMX, or you just want to make some maps, install Tiled, a GUI editor, and play around with it. Tiled’s wiki and IRC channel are places to go if you have questions about the TMX format.

If you’re looking to use maps in a game, chances are tmxlib won’t help you much. Try pytmxloader, PyTMX, or one of the other projects listed on the Tiled wiki.


To install tmxlib, you can use pip: pip install --user tmxlib. To install system-wide, leave out the --user option.

If you can’t find pip on your system, look around. In Fedora, it’s named pip-python and lives in the python-pip package.

Optionally, also install the lxml and PIL packages to speed up XML and image handling, respectively. Linux distributions are likely to have them (in Fedora, yum install python-lxml python-imaging). If you can’t find them, use pip to get them.


The project is hosted on Github (as pytmxlib), free for anyone to file bugs, clone, fork, or otherwise help make it better.

To install the library for development, navigate to the source folder, and run python develop.


To run tests, pip install pytest-cov, and run py.test.

Tests can be run using tox, to ensure cross-Python compatibility. Make sure you have all supported Pythons (2.6, 2.7, 3.1, 3.2) installed, and run tox.

Nowadays we use Travis CI to run tests after each commit: (Link to Travis CI).


This documentation is generated using Sphinx. To build it, pip install sphinx and run make in the doc/ directory.

Versioning & TODO

This package sports the SemVer versioning scheme. In this pre-1.0 version, that doesn’t mean much.

Version 1.0 will include at least one generally useful command-line utility, most likely a crop/merge tool for maps.

Indices and tables

Table Of Contents

Next topic


This Page