Greek Key Meander Generator
This Python script generates Greek key meander patterns as SVG and PNG images.
Examples
Rectangle
Circle
Description
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.
Installation
You can install the package from PyPI:
pip install greek_meander
This 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.
Usage
The script can be run from the command line with different subcommands to generate various types of meander patterns.
General Options
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.
Rectangle Pattern
To generate a rectangular meander pattern, use the rect subcommand.
meander rect [options]
Rectangle 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. |
Rectangle Example
To run the python script directly
python meander.py --stroke-color "#AB8E0E" --stroke-opacity 0.7 rect --width 24 --height 13 --size 10
Or if you installed greak_meander
meander --stroke-color "#AB8E0E" --stroke-opacity 0.7 rect --width 24 --height 13 --size 10
Circle Pattern
To generate a circular meander pattern, use the circle subcommand.
meander circle [options]
Circle Options
| Argument | Type | Default | Description |
|---|---|---|---|
--pattern-count |
int | 30 | Number of patterns in the circle. |
--radius |
int | 300 | The radius of the circle. |
Circle Example
To run the python script directly
python meander.py --stroke-color green --file images/meander_circle circle
Or if you installed greak_meander
meander --stroke-color green --file images/meander_circle circle
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for greek-meander 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| greek_meander-0.1.0.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| greek_meander-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / greek_meander-0.1.0.tar.gz
| Download URL | greek_meander-0.1.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2509b305807e43650393121f9e8a0dd73d233235a86e7cbcdfb2690116ecb11
|
|
BLAKE2b-256 checksum How to use checksums |
2ad04a417be42a471e4521f3d24d2062b56692a8f8de05dc6547211502104a3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Release files / greek_meander-0.1.0-py3-none-any.whl
| Download URL | greek_meander-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcf10ea20eca3c2093a923d49be277749de27ea0e7f4e4424b033682f762be36
|
|
BLAKE2b-256 checksum How to use checksums |
aa69976601cad6bd39cfa886479fee725ce971674d90382891af230b20cd63c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|