An open API service indexing awesome lists of open source software.

https://github.com/thegoodduck/pattern_generator

Pattern Generator
https://github.com/thegoodduck/pattern_generator

algorithm generator noai notai pattern

Last synced: 4 months ago
JSON representation

Pattern Generator

Awesome Lists containing this project

README

          

# ๐ŸŒˆ Pattern Generator


Python 3.7+
Flask 2.0+
License: MIT
Status: Active

## ๐Ÿ“‹ Overview

Pattern Generator is a web application that creates customized patterns for various use cases including testing, education, and creative projects. The tool allows users to generate patterns with different complexity levels and character sets, outputting the results in a visually appealing PDF format with random placement and colorful text.

### ๐ŸŽฏ Key Features

- **Customizable Pattern Generation**: Control pattern complexity with adjustable difficulty levels
- **Character Set Selection**: Use digits, letters, or custom character sets for pattern creation
- **Multiple Pattern Generation**: Create several different patterns in a single PDF document
- **Beautiful Output**: Colorful, visually appealing PDF output with rainbow-colored text
- **Flexible Rendering Options**: Supports WeasyPrint (emoji-friendly) and ReportLab PDF backends

[Proof of Concept (ptgen.pythonanywhere.com)](https://ptgen.pythonanywhere.com)
## ๐Ÿš€ Installation

### Prerequisites
- Python 3.7+
- pip (Python package manager)

### Setup

1. Clone the repository:
```bash
git clone https://github.com/thegoodduck/Pattern_Generator.git
cd Pattern_Generator
```

2. Create a virtual environment (recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

3. Install dependencies:
```bash
pip install flask weasyprint reportlab
```

## ๐Ÿ’ป Usage

### Running the Application

1. Start the Flask server:
```bash
python main.py
```

2. Open your web browser and navigate to:
```
http://127.0.0.1:5000
```

### Creating Patterns

1. Set your desired **Difficulty Level** (higher values create more complex patterns)
2. Enter a **Character Set** (digits for numeric patterns, any characters for text patterns)
3. Optionally add additional patterns using the "Add Another Pattern" button
4. Click "Generate PDF" to create and download your custom pattern document

### Examples

#### Numeric Pattern
- **Difficulty**: 5
- **Character Set**: 0123456789
- **Result**: A pattern using random digits with mathematical operations applied

#### Text Pattern
- **Difficulty**: 3
- **Character Set**: ABCDEF
- **Result**: A repeating sequence of randomly selected letters

## โš™๏ธ Pattern Generation Algorithms

The application uses three different algorithms to generate patterns:

1. **Simple Repetition**: Repeats a randomly generated character sequence
2. **Selective Digit Modification**: Applies mathematical operations to specific positions in a sequence
3. **Full Sequence Transformation**: Applies operations to every character in a sequence

## ๐Ÿ”ง Customization

### PDF Backend Selection

The application supports two PDF generation backends:

```python
# In main.py:
USE_WEASYPRINT = True # Set to False to use ReportLab instead
```

- **WeasyPrint**: Better support for emoji and complex characters
- **ReportLab**: More lightweight, fewer dependencies

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

## ๐Ÿ‘ค Author

Made with โค๏ธ by [@thegoodduck](https://github.com/thegoodduck)

---


โญ Star this repository if you find it useful! โญ



Report Bug ยท
Request Feature