QR-Codes
Enums
QRCodeType
| Name | Explanation | int |
|---|---|---|
TEXT | Pure textcontent | 1 |
EMAIL | Email-content using the mailto:-scheme | 2 |
HYPERLINK | Hyperlink | 3 |
SMS | SMS-content using the smsto:-scheme | 4 |
VCARD | VCard-content. See Wikipedia article for more information | 5 |
GEO | Geo-Coordinates Latitude, Longitude (optionally altitude) | 6 |
WIFI | Wifi-connection-details (Type, SSID, PAssword, Hidden) | 7 |
VCAL | VCalender-content. See Wikipedia article for more information | 8 |
Methods
create_qr_code_text(...)
(frame, content = "", error_correction = "M", strict = True, include_text = False, color_qrcode = None, color_bg = None)
| Parameters: | frame (comet.CFrame) The frame in the document, in which the QR-code should be inserted to. |
| content (str) Text-content for the QR-code. Can be a text prepared for specific QR-code-types (for example E-Mail with mailto:...). | |
| error_correction (str) One of the following Error Correction Levels: L (low; 7% Loss recovery possible), M (medium; 15% Loss recovery possible), H (high; 20% Loss recovery possible), Q (quality; 30% Loss recovery possible) | |
| strict (bool) Whether or not to abort, if Byte-length validation fails. | |
| include_text (bool) Should the QR-content be displayed as text below the QR-code? | |
| color_qrcode (comet.CColor) A color for the QR-code elements. | |
| color_bg (comet.CColor) A color for the background behind the QR-code. | |
| Returns: | Whether the QR-Code was created successfully. |
| Return Type: | bool |
create_qr_code(...)
(frame, contents, qrcode_type = QRCodeType.TEXT, error_correction = "M", strict = True, include_text = False, color_qrcode = None, color_bg = None)
| Parameters: | frame (comet.CFrame) The frame in the document, in which the QR-code should be inserted to. |
| contents (dict[str,str]) Contents to be incorporated in the QR-Code. Depending on the qrcode_type, different values are expected in the dictionary Explanations for keys and values see below. | |
| qrcode_type (QRCodeType) One of the QR-Code-types defined in the Enum QRCodeType. | |
| error_correction (str) One of the following Error Correction Levels: L (low; 7% Loss recovery possible), M (medium; 15% Loss recovery possible), H (high; 20% Loss recovery possible), Q (quality; 30% Loss recovery possible) | |
| strict (bool) Whether or not to abort, if Byte-length validation fails. | |
| include_text (bool) Should the QR-content be displayed as text below the QR-code? | |
| color_qrcode (comet.CColor) A color for the QR-code elements. | |
| color_bg (comet.CColor) A color for the background behind the QR-code. | |
| Returns: | Whether the QR-Code was created successfully. |
| Return Type: | bool |
Options for Parameter contents:
TEXT
| Key | Description / Example |
|---|---|
| text | Hello World! |
| Key | Description / Example |
|---|---|
| email_address | info@priint.com |
| email_cc | Optionalinfo.cc@priint.com |
| email_bcc | Optionalinfo.bcc@priint.com |
| email_subject | OptionalQuarterly Numbers |
| email_body | OptionalHello,\nhere are the quarterly numbers: 42, 39, 87, 11.\nBest Regards |
HYPERLINK
SMS
| Key | Description / Example |
|---|---|
| sms_phone_number | +0 000 00000 |
| sms_message | OptionalHello World! |
VCARD
| Key | Description / Example |
|---|---|
| vcard_honorprefix | Mr. |
| vcard_firstname | John |
| vcard_middlename | X. |
| vcard_lastname | Smith |
| vcard_honorsuffix | Jr. |
| vcard_postoffice | P.O. Box 0000 |
| vcard_extendedadress | |
| vcard_street | 123 Main Street |
| vcard_locality | Any Town |
| vcard_region | CA |
| vcard_postalcode | 91921-1234 |
| vcard_country | U.S.A. |
| vcard_tel | +0 000 00000 |
| vcard_tel_pref | +0 000 00000 |
| vcard_tel_work | +0 000 00000 |
| vcard_tel_home | +0 000 00000 |
| vcard_tel_fax | +0 000 00000 |
| vcard_tel_msg | +0 000 00000 |
| vcard_tel_cell | +0 000 00000 |
| vcard_email | info@priint.com |
| vcard_bday | 19960415--0415 |
| vcard_categories | TRAVEL AGENTINTERNET,INDUSTRY,INFORMATION TECHNOLOGY |
| vcard_gender | A single letter (optionally followed by ;{text}).`` (empty) M (male)F (female)O (other)N (none / not applicable)U (unknown)For Example: M;FellowF;grrrlO;intersex;it's complicated |
| vcard_lang | enfr |
| vcard_note | This fax number is operational 0800 to 1715 EST\, Mon-Fri. |
| vcard_org | PRIINT GROUP |
| vcard_title | Chief Happiness Officer |
| vcard_role | Coffee & Nutrition Manager |
| vcard_timezone | Raleigh/North America |
| vcard_url | http://priint.com |
GEO
| Key | Description / Example |
|---|---|
| geo_latitude | 51.44110352294343 |
| geo_longitude | 6.773927670685315 |
| geo_altitude | Optional |
WIFI
| Key | Description / Example |
|---|---|
| wifi_network_type | WPAWEPnopass (open networks) |
| wifi_network_name | Guest Network |
| wifi_password | password123 |
| wifi_hidden | Optionalfalse (default)true |
VCAL
| Key | Description / Example |
|---|---|
| vcal_uid | From Wikipedia: "The UID field distributes updates when a scheduled event changes. When the event is first generated a globally unique identifier is created. If a later event is distributed with the same UID, it replaces the original one." a678ds@priint.com |
| vcal_datestamp | Datestring in Format YYYYMMDDTHHMMSSZ20250701T100000Z |
| vcal_datestart | Datestring in Format YYYYMMDDTHHMMSSZ20250704T171000Z |
| vcal_dateend | Datestring in Format YYYYMMDDTHHMMSSZ20250704T041800Z |
| vcal_summary | Important meeting |
| vcal_location | Meeting Room 1 |
| vcal_description | This is an important meeting |
| vcal_organizer_name | John Smith |
| vcal_organizer_email | info@priint.com |