Simple pattern generation library for Python
Project description
patlab
Patlab is a lightweight Python library for generating common text-based patterns such as squares, pyramids, and triangles with clean and customizable APIs.
It’s designed for beginners, educators, and developers who want a simple way to generate patterns programmatically.
✨ Features
- Generate common patterns easily:
- Squares
- Pyramids (centered, right-aligned, numeric)
- Right-angled triangles (classic, inverted)
- Support for:
- Custom characters
- Hollow patterns
- Numeric patterns
- Clean, readable API design
- Minimal dependencies
📦 Installation
Install via pip:
pip install patlab
🚀 Quick Start
from patlab import *
print(square(3))
print(pyramid(4))
print(right_triangle(4))
📐 Examples
Square
from patlab import square as sq
print(sq(4))
print(sq(4, "#"))
****
****
****
****
####
####
####
####
For full documentation, see: https://sayampradhan.github.io/patlab/
📜 License
This project is licensed under the terms of the MIT License. See: https://github.com/sayampradhan/patlab/blob/main/LICENSE
🤝 Contributing
Contributions are welcome!
If you’d like to improve Patlab, please visit the repository and submit a pull request: https://github.com/sayampradhan/patlab
💡 Inspiration
Patlab is inspired by classic programming exercises used to teach loops, logic, and formatting in Python.
If you've ever written code to print stars (*) in shapes like pyramids, triangles, or squares while learning Python, you've already experienced the core idea behind this library.
Patlab builds on those foundational exercises by:
- Turning repetitive pattern-printing logic into reusable functions
- Providing clean abstractions over nested loops
- Making it easier to experiment with variations (hollow, numeric, aligned patterns)
- Helping beginners transition from practice problems to structured code
It aims to bridge the gap between learning concepts and building reusable tools, making pattern generation both educational and practical.
Project details
Release history Release notifications | RSS feed
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 patlab-0.2.14.tar.gz.
File metadata
- Download URL: patlab-0.2.14.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e1b5503f6d73e67b701094e32ba606880ce2b1bc72840036c2be2c4bae62585
|
|
| MD5 |
4ade2bb0ec5fa3d54474e38d95dedaa1
|
|
| BLAKE2b-256 |
02e294173344f91b2bb87e57968275ebdbe81ea50c0411596f33fae0af7ec090
|
File details
Details for the file patlab-0.2.14-py3-none-any.whl.
File metadata
- Download URL: patlab-0.2.14-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17776668331858ac082589c9b22d5152c5afa3fc700fa19bc157fc02f79028f
|
|
| MD5 |
54f154c531dff2ca4e53d674f05cf8b4
|
|
| BLAKE2b-256 |
43d06e0cf469ac00a1a29e8411c5898a241cc267e64f3aee67b4ba8f08ee59f2
|