This Python script generates Greek key meander patterns as SVG and PNG images.
The script uses the drawsvg library to create the pattern and cairosvg to convert it to a PNG image. The pattern's dimensions, colors, and other properties can be customized through command-line arguments.
You can install the package from PyPI:
pip install greek_meanderThis will also install the required dependencies: drawsvg and cairosvg.
Or you can install via pip the two packages above then run the script meander.py directly.
The script can be run from the command line with different subcommands to generate various types of meander patterns.
These options apply to all pattern types:
| Argument | Type | Default | Description |
|---|---|---|---|
--stroke-width |
float | 2.0 | Line thickness in pixels. |
--stroke-color |
str | '#AB8E0E' | Line color (name, hex, or RGB). |
--stroke-opacity |
float | 0.7 | Line transparency (0.0 to 1.0). |
--border-margin |
int | 1 | The margin of borders. |
--file |
str | 'meander' | Output filename for SVG and PNG. |
N.B. you need to have general options before rect or circle subcommand, followed by subcommand specific options.
To generate a rectangular meander pattern, use the rect subcommand.
meander rect [options]| Argument | Type | Default | Description |
|---|---|---|---|
--size |
int | 10 | Size of the pattern unit. |
--width |
int | 16 | Number of patterns horizontally. |
--height |
int | 9 | Number of patterns vertically. |
To run the python script directly
python meander.py --stroke-color "#AB8E0E" --stroke-opacity 0.7 rect --width 24 --height 13 --size 10Or if you installed greak_meander
meander --stroke-color "#AB8E0E" --stroke-opacity 0.7 rect --width 24 --height 13 --size 10To generate a circular meander pattern, use the circle subcommand.
meander circle [options]| Argument | Type | Default | Description |
|---|---|---|---|
--pattern-count |
int | 30 | Number of patterns in the circle. |
--radius |
int | 300 | The radius of the circle. |
To run the python script directly
python meander.py --stroke-color green --file images/meander_circle circleOr if you installed greak_meander
meander --stroke-color green --file images/meander_circle circleThis project is licensed under the MIT License - see the LICENSE file for details.

