Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds README file and fixes typo #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 107 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,107 @@
# qrgen
QR Code generator container
# QR Code Generator with Logo - qrgen

A Python-based QR code generator that allows you to create QR codes with embedded logos and custom colors. This tool can be run using Docker, virtual environment, or as a standalone Python application.

## Prerequisites

For Docker:
- Docker installed on your system

For venv/standalone:
- Python 3.8 or higher
- pip (Python package installer)


## Getting Started

Clone the repository or download the source code:
```bash
git clone <repository-url-using-https-or-ssh>
cd qrgen
```

### Option 1: Docker Installation


Build the Docker image:
```bash
docker build -t qrgen .
```
Run the Docker image and generate default qr code:
```bash
docker run -v $(pwd):/app qrgen python makeqr
```

### Option 2: Virtual Environment (recommended)

Create and activate a virtual environment:

On macOS/Linux:
```bash
python -m venv venv
source venv/bin/activate
```

On Windows:
```bash
python -m venv venv
venv\Scripts\activate
```

Install dependencies:
```bash
pip install -r requirements.txt
```

```bash
python makeqr
```

### Option 3: Standalone Installation

Install dependencies globally:
```bash
pip install -r requirements.txt
```

```bash
python makeqr
```

### Command Line Options

- `--logo`: Path to the logo image file (optional)
- `--url`: The URL or text to encode in the QR code (default: https://www.geeksforgeeks.org/)
- `--color`: The color of the QR code (default: Green)
- `--basewidth`: The base width of the logo image (default: 100)


### Usage Examples

The generated QR code will be saved in the current directory with the following naming convention:
- With logo: `{logo_name}_with_QR.png`
- Without logo: `qr_code_with_QR.png`

(If you are running Docker, prepend each of these with `docker run -v $(pwd):/app qrgen` )

#### Generate a QR code with a custom URL and color:

```bash
python makeqr --url "https://example.com" --color "Blue"
```

#### Generate a QR code with a logo:

```bash
python makeqr --logo "logo.png" --url "https://example.com" --color "Red" --basewidth 150
```

### Running Tests

```bash
python -m unittest test_helpers.py -v
```

### License

GNU GENERAL PUBLIC LICENSE
2 changes: 1 addition & 1 deletion makeqr
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if __name__ == "__main__":
(QRimg.size[1] - basewidth) // 2)
QRimg.paste(resized_logo, pos)

file_name = f"{logo_file}_with_QR_code.png" if logo else f"QR_code.png"
file_name = f"{logo_file}_with_QR_code.png" if args.logo else f"QR_code.png"

# save the QR code generated
QRimg.save(file_name)
Expand Down