simetri is a Python library for creating and manipulating patterns.
Project description
simetri.graphics 
simetri.graphics is a graphics library for Python that focuses on 2D symmetry operations and pattern generation. It uses the TikZ library (see https://tikz.net) and generates .tex files that can be compiled to create output files. It can also be used in Jupyter notebooks to create complex geometric patterns and designs. The library is designed to be easy to use and flexible, allowing users to create a wide variety of symmetrical patterns with minimal effort. The library also includes a number of computational geometry utility functions for working with 2D geometry.
It is designed to be used in conjunction with XeLaTeX rendering engine. Currently the project is in its late alpha stages and is not ready for production use. Beta release is expected to be in March 2025. Although this version is a proof of concept and is likely to change significantly in the future, it is already capable of producing some interesting results.
simetri.graphics can generate output files with .tex, .pdf, .ps, .eps, .svg, or .png extensions. It can also generate Jupyter notebook cells with the output embedded in them.
The documentation is available at simetri. There is also a gallery of examples available at simetri/gallery.
Version
This is the first alpha version of the library and is not yet ready for production use. The library is still in its early stages of development and is likely to change significantly in the near future. The beta release is expected to be in March 2025.
Installation
If you have a Python version >= 3.9 installed, execute the following command in the terminal:
pip install simetri
This will not install a LaTeX distribution, so you will need to install one separately.
Install a LaTeX distribution
There are several LaTeX distributions freely available for different operating systems. The recommended distribution is the MikTeX app.
MikTeX handles package installations automatically, so it is recommended for users who are not familiar with LaTeX typesetting engines.
MiKTeX can be downloaded from https://miktex.org/download.
Requirements
- Python version 3.9 or later.
- A LaTeX distribution with XeLaTeX engine is required for rendering the output. Miktex is the recommended distribution since it handles installation of required packages automatically.
The library requires the following Python packages:
numpynetworkxmatplotlibPillowIPythonpymupdfstrenumtyping-extensions
These extensions are installed automatically when you install the library using pip or uv.
Example
import simetri.graphics as sg
canvas = sg.Canvas()
star = sg.stars.Star(n=12)
swatch = sg.swatches_255[9]
lace = sg.Lace(star.level(4), offset=5, swatch=swatch)
canvas.draw(lace)
canvas.display()
Documentation
[!NOTE] Never import the library using
from simetri import *orfrom simetri.graphics import *.
Contact
If you have any questions or suggestions, please feel free to contact me at fbasegmez@gmail.com
Feedback
If you have any feedback or suggestions for the library, please feel free to open an issue on the GitHub repository or contact me by email. I am always looking for ways to improve the library and make it more useful for users.
License
This project is licensed under the GNU General Public License v2.0 (GPLv2) - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simetri-0.0.3.tar.gz.
File metadata
- Download URL: simetri-0.0.3.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d523126d227476ca6f6cee36cc43ac2da4f90929e7a35baa60b926de74c06f05
|
|
| MD5 |
65ddb8685a51c062963b48208e3b6eed
|
|
| BLAKE2b-256 |
f6c1c5606a1f96bff7589271692db813534704d97048adeec98c1d54f3c77473
|
File details
Details for the file simetri-0.0.3-py3-none-any.whl.
File metadata
- Download URL: simetri-0.0.3-py3-none-any.whl
- Upload date:
- Size: 244.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e799696304bd054249a714817fc7678a32d703c6b722c946449e1917fa7c55c
|
|
| MD5 |
1b5170039ed00fd7ac0ef36de3f10481
|
|
| BLAKE2b-256 |
d2015e38afb41f829f05dfe4f1be46db6e5b78f14f5893b84a593a2c067d1ab8
|