diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 74f237b..617334c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python application +name: pytest on: push: diff --git a/README.md b/README.md index 9dc3b7b..75f97e1 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,19 @@ This is an rMQR Code image generator implemented in Python. This is implemented based on [ISO/IEC 23941:2022](https://www.iso.org/standard/77404.html). -## Important Notice + +## πŸ“Œ Important Notice Please verify an image generated by this software whether it can decode correctly before use. -## Basic Usage + +## πŸš€ Installation +``` +pip install rmqrcode +``` + + +## πŸ“• Basic Usage +### Generate rMQR Code ```py from rmqrcode import rMQR import rmqrcode @@ -20,11 +29,11 @@ qr = rMQR.fit( ) ``` -The `ecc` parameter is an enum value of rmqrcode.ErrorCorrectionLevel to select error correction level. The following values are available: +The `ecc` parameter is an enum value of `rmqrcode.ErrorCorrectionLevel` to select error correction level. The following values are available: - **`ErrorCorrectionLevel.M`**: Approx. 15% Recovery Capacity. - **`ErrorCorrectionLevel.H`**: Approx. 30% Recovery Capacity. -The `fit_strategy` parameter is enum value of rmqrcode.FitStrategy to specify how to determine size of rMQR Code. The following values are available: +The `fit_strategy` parameter is enum value of `rmqrcode.FitStrategy` to specify how to determine size of rMQR Code. The following values are available: - **`FitStrategy.MINIMIZE_WIDTH`**: Try to minimize width. - **`FitStrategy.MINIMIZE_HEIGHT`**: Try to minimize height. - **`FitStrategy.BALANCED`**: Try to keep balance of width and height. @@ -32,7 +41,17 @@ The `fit_strategy` parameter is enum value of rmqrcode.FitStrategy to specify ho Here is an example of images genereated by each fit strategies for data `Test test test`: ![Example of fit strategies](https://user-images.githubusercontent.com/14174940/172822478-4f2b5fb8-49bd-464f-b6b2-c7347f71cbf5.png) -## Advanced Usage +### Save as image +```py +from rmqrcode import QRImage + +image = QRImage(qr, module_size=8) +image.show() +image.save("my_qr.png") +``` + + +## πŸ“š Advanced Usage ### Select rMQR Code size manually To select rMQR Code size manually, use `rMQR()` constructor. ```py @@ -40,6 +59,30 @@ qr = rMQR('R11x139', ErrorCorrectionLevel.H) qr.make("https://oudon.xyz") ``` +`R11x139` means 11 rows and 139 columns. The following table shows available combinations. + +| |27|43|59|77|99|139| +|-|:-:|:-:|:-:|:-:|:-:|:-:| +|R7|❌|βœ…|βœ…|βœ…|βœ…|βœ…| +|R9|❌|βœ…|βœ…|βœ…|βœ…|βœ…| +|R11|βœ…|βœ…|βœ…|βœ…|βœ…|βœ…| +|R13|βœ…|βœ…|βœ…|βœ…|βœ…|βœ…| +|R15|❌|βœ…|βœ…|βœ…|βœ…|βœ…| +|R17|❌|βœ…|βœ…|βœ…|βœ…|βœ…| + + +## πŸ› οΈΒ Under the Hood +### Encoding modes + +The rMQR Code has the four encoding modes Numeric, Alphanumeric, Byte and Kanji to convert data efficiently. However, this package supoprts only Byte mode currently. + +|Mode|Supported?| +|-|:-:| +|Numeric| | +|Alphanumeric|| +|Byte|βœ…| +|Kanji|| + ---- The word "QR Code" is registered trademark of DENSO WAVE Incorporated.
http://www.denso-wave.com/qrcode/faqpatent-e.html diff --git a/setup.cfg b/setup.cfg index d82df4f..5086838 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = rmqrcode -version = 0.1.0 +version = 0.1.1 author = Takahiro Tomita author_email = ttp8101@gmail.com description = An rMQR Code Generetor