easy-tiler
easy-tiler is a Python library for creating images of patterns made of tiles on a grid. It leverages Pycairo to produce high-quality PNG and SVG outputs.
Whether you're looking to generate geometric art, architectural patterns, or simple tiling textures, easy-tiler provides a flexible API and CLI to configure tile shapes, colors, and grid geometry.
Examples
Polygon Tiles
from easy_tiler.io import save_png, save_svg
from easy_tiler.factories import make_tile_factory
from easy_tiler.grid import Grid
# Define a 8x6 grid with 80x80px cells
grid = Grid(8, 6, x_size=80, y_size=80)
# Create a factory for polygon tiles (default is a square)
factory = make_tile_factory(
tile_type='polygon', secondary_color='white', primary_color='random', sides=4, gridlines=False
)
# Save as PNG and SVG
save_png('output.png', grid, factory)
save_svg('output.svg', grid, factory)
This would produce an image of 8x6 squares with random colors, similar to the image below.
Sequence of Tiles
Use make_sequence_factory to repeat a sequence of tile rotations across each row. The
foreground and background colors can also be selected from a palette for each position in
the sequence.
from easy_tiler.factories import make_sequence_factory
from easy_tiler.grid import Grid
from easy_tiler.io import save_png, save_svg
# Define a 12x10 grid with 60x60px cells
grid = Grid(12, 10, x_size=60, y_size=60)
# Repeat four Riley tile rotations with palette-based colors
factory = make_sequence_factory(
tile_type='riley',
tile_sequence=[2, 2, 3, 3, 1, 0],
primary_color='sequence',
secondary_color='roll',
palette='ColorsOfTheWind',
)
save_png('sequence_demo.png', grid, factory)
save_svg('sequence_demo.svg', grid, factory)
Here, tile_sequence controls the repeating rotation pattern, while primary_color='sequence' and
secondary_color='roll' vary the tile colors across the sequence. This would produce an images similar this
one:
Key Features
- Multiple Tile Types: Support for regular polygons (triangles, squares, etc.), Truchet tiles, Riley tiles, and Puck (circle-based) tiles.
- Configurable Grids: Define grid size, cell size, and origin.
- Advanced Geometry: Apply skew angles (shear) and shifts to create dynamic and complex tiling patterns.
- Pycairo Backend: High-performance rendering with support for transparency and vector/raster export.
- CLI Tool: Render configured PNG and SVG patterns from YAML.
Installation
easy-tiler requires Python 3.13 or higher.
From PyPI
Install the released package from PyPI with uv:
uv tool install easy-tiler
Or use pip:
pip install easy-tiler
From a cloned repository
To install easy-tiler with uv sync, first clone the repository and run the command from the repository root:
git clone https://github.com/jobar8/easy-tiler.git
cd easy-tiler
uv sync
Quick Start
Python API
Here is a simple example to render a grid of squares:
from easy_tiler.io import save_png, save_svg
from easy_tiler.factories import make_tile_factory
from easy_tiler.grid import Grid
# Define a 10x10 grid with 80x80px cells
grid = Grid(10, 10, x_size=80, y_size=80)
# Create a factory for polygon tiles (default is a square)
factory = make_tile_factory(
tile_type='polygon', secondary_color='white', primary_color='black', sides=4, gridlines=False
)
# Save as PNG and SVG
save_png('output.png', grid, factory)
save_svg('output.svg', grid, factory)
CLI Usage
Create a YAML file with grid, factory, and output settings:
grid:
width: 8
height: 6
x_size: 80
y_size: 80
factory:
type: tile # tile, sequence, node, or form
tile_type: circle
primary_color: [blue, red, green, brown]
secondary_color: white
radius: 0.3
stroke: true
stroke_color: black
palette: FridaKahlo
num_colors: 5
output:
path: images/circle-pattern # output basename, relative to this YAML file
formats: [png, svg] # either, or both
scale: 1
background_col: white
Run the installed command with the config path:
easy-tiler pattern.yaml
The output section's formats defaults to [png, svg]. The selected formats are
written with matching extensions; output.path is a basename, and its parent
directory is created if needed. Paths that are not absolute are resolved relative
to the YAML file. Output settings also accept scale and background_col.
The factory.type setting selects make_tile_factory, make_sequence_factory,
make_node_factory, or make_form_factory. Their remaining options are passed
to the corresponding factory; factory-specific options include tile_sequence,
node_sequence, a, b, c, rotation_mod, and color_mod. Tile shape
options such as radius, side_length, sides, and arrow_width, along with
color options such as primary_color, secondary_color, palette, stroke,
and stroke_color, can be configured as shown above. A node sequence is written
as a 2D YAML list.
Development
- Build system: Uses
uv_build. - Linting & Formatting: Uses
Ruff. - Testing: Uses
pytest.
To run tests:
pytest
License
This project is authored by Joseph Barraud and is licensed under the Apache License, Version 2.0. See LICENSE.txt for the full license text.
Metadata
Release files for easy-tiler 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easy_tiler-1.0.3.tar.gz | 15.7 kB | With provenance | Details for easy_tiler-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| easy_tiler-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for easy_tiler-1.0.3-py3-none-any.whl |
Total release size: 33.9 kB
Release files / easy_tiler-1.0.3.tar.gz
| Download URL | easy_tiler-1.0.3.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce5b92a1edbc48656a999d1ed7524b83d74059910dd14bc3da06c677c09049b1
|
|
BLAKE2b-256 checksum How to use checksums |
e6e532584c6fbf2093492c2bb6bb086cc58583ba3a33b22bc0ede2cc5477cc70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / easy_tiler-1.0.3-py3-none-any.whl
| Download URL | easy_tiler-1.0.3-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3f8b0b737b6bc06121b2387dcf2220dd4dbfa26475d29c107938d8de02b397c
|
|
BLAKE2b-256 checksum How to use checksums |
7879a2d2aa4e571975ec4a6bdde788e2a2edd2d28f9a089925fa64002390098a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for easy-tiler 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for easy_tiler-1.0.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.