maze-generator / README.md
utarn's picture
Update project dependencies and configuration
c68439e
---
title: Maze Generator
emoji: 🎯
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.46.1
app_file: app.py
pinned: false
license: mit
---
# Maze Generator
A Gradio web interface that generates custom maze PDFs from https://www.mazegenerator.net/ with customizable dimensions and quantities.
## Features
- Generate multiple maze PDFs with specified dimensions
- Extract only the first page from each PDF (to remove solution pages)
- Web interface with progress tracking
- Merge multiple PDFs into a single file
- Real-time file list updates
## How to Use
1. **Generate Mazes Tab:**
- Set the number of mazes you want to generate (1-50)
- Specify width and height in cells (2-200)
- Click "Generate Mazes" to create the PDFs
- View generated files in the file list
2. **Merge PDFs Tab:**
- Click "Merge All PDFs" to combine all PDFs in the pdfs/ directory
- The merged file will be saved as `merged_mazes.pdf`
- Individual files will be deleted after merging
## Technical Details
- Each maze is generated with random patterns
- PDFs are saved in the `pdfs/` directory
- File naming pattern: `maze_{width}x{height}_{number}.pdf`
- The app automatically handles file name conflicts by incrementing numbers
## Dependencies
- `gradio`: Web interface framework
- `pandas`: Data manipulation
- `pypdf`: PDF processing and merging
- `requests`: HTTP requests to maze generator API
## Deployment
This app is designed to be deployed on Hugging Face Spaces. The deployment configuration is specified in the front matter of this README.md file.
## Local Development
To run this app locally:
1. Clone the repository
2. Create a virtual environment: `python -m venv venv`
3. Activate the environment: `source venv/bin/activate` (Linux/Mac) or `venv\Scripts\activate` (Windows)
4. Install dependencies: `pip install -e .`
5. Run the app: `python app.py`
The app will be available at `http://localhost:7861`