Skip to content

API Reference

GamingOP69 edited this page Apr 30, 2025 · 1 revision

API Reference

QRCodeX Class

Constructor Parameters

  • error_correction: Error correction level ('L', 'M', 'Q', 'H')
  • box_size: Size of each QR code module in pixels
  • border: Border size in modules
  • version: QR code version (1-40), or None for auto

Methods

  • add_data(data, data_type=None)
  • generate(file_path, **kwargs)

ErrorCorrectionLevel Class

  • LOW: 7% data recovery
  • MEDIUM: 15% data recovery
  • QUARTILE: 25% data recovery
  • HIGH: 30% data recovery

Error Handling

Common Exceptions

QRCodeXError

Base exception class for all QRCodeX errors.

Common Error Scenarios

  1. Data capacity exceeded
  2. Invalid file format
  3. Unsupported data type
  4. Invalid error correction level

Error Prevention

  • Always check data size limits
  • Validate input data types
  • Use try-except blocks for error handling

Contributing Guidelines

Development Setup

  1. Fork the repository
  2. Clone your fork
  3. Set up development environment
  4. Create a feature branch

Code Style

  • Use Black for formatting
  • Follow PEP 8 guidelines
  • Add type hints
  • Write docstrings

Testing

  • Write unit tests for new features
  • Ensure all tests pass
  • Maintain code coverage

Clone this wiki locally