types-qrcode 7.4.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- types-qrcode-7.4.0.0/CHANGELOG.md +8 -0
- types-qrcode-7.4.0.0/MANIFEST.in +1 -0
- types-qrcode-7.4.0.0/PKG-INFO +31 -0
- types-qrcode-7.4.0.0/qrcode-stubs/LUT.pyi +3 -0
- types-qrcode-7.4.0.0/qrcode-stubs/METADATA.toml +5 -0
- types-qrcode-7.4.0.0/qrcode-stubs/__init__.pyi +10 -0
- types-qrcode-7.4.0.0/qrcode-stubs/base.pyi +25 -0
- types-qrcode-7.4.0.0/qrcode-stubs/console_scripts.pyi +12 -0
- types-qrcode-7.4.0.0/qrcode-stubs/constants.pyi +4 -0
- types-qrcode-7.4.0.0/qrcode-stubs/exceptions.pyi +1 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/__init__.pyi +0 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/base.pyi +50 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/pil.pyi +11 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/pure.pyi +16 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styledpil.pyi +22 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styles/__init__.pyi +0 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styles/colormasks.pyi +65 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styles/moduledrawers/__init__.pyi +8 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styles/moduledrawers/base.pyi +12 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styles/moduledrawers/pil.pyi +69 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/styles/moduledrawers/svg.pyi +59 -0
- types-qrcode-7.4.0.0/qrcode-stubs/image/svg.pyi +42 -0
- types-qrcode-7.4.0.0/qrcode-stubs/main.pyi +70 -0
- types-qrcode-7.4.0.0/qrcode-stubs/release.pyi +1 -0
- types-qrcode-7.4.0.0/qrcode-stubs/util.pyi +54 -0
- types-qrcode-7.4.0.0/setup.cfg +4 -0
- types-qrcode-7.4.0.0/setup.py +45 -0
- types-qrcode-7.4.0.0/types_qrcode.egg-info/PKG-INFO +31 -0
- types-qrcode-7.4.0.0/types_qrcode.egg-info/SOURCES.txt +29 -0
- types-qrcode-7.4.0.0/types_qrcode.egg-info/dependency_links.txt +1 -0
- types-qrcode-7.4.0.0/types_qrcode.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include CHANGELOG.md
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: types-qrcode
|
|
3
|
+
Version: 7.4.0.0
|
|
4
|
+
Summary: Typing stubs for qrcode
|
|
5
|
+
Home-page: https://github.com/python/typeshed
|
|
6
|
+
License: Apache-2.0 license
|
|
7
|
+
Project-URL: GitHub, https://github.com/python/typeshed
|
|
8
|
+
Project-URL: Changes, https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/qrcode.md
|
|
9
|
+
Project-URL: Issue tracker, https://github.com/python/typeshed/issues
|
|
10
|
+
Project-URL: Chat, https://gitter.im/python/typing
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Typing :: Stubs Only
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
## Typing stubs for qrcode
|
|
17
|
+
|
|
18
|
+
This is a PEP 561 type stub package for the `qrcode` package. It
|
|
19
|
+
can be used by type-checking tools like
|
|
20
|
+
[mypy](https://github.com/python/mypy/),
|
|
21
|
+
[pyright](https://github.com/microsoft/pyright),
|
|
22
|
+
[pytype](https://github.com/google/pytype/),
|
|
23
|
+
PyCharm, etc. to check code that uses
|
|
24
|
+
`qrcode`. The source for this package can be found at
|
|
25
|
+
https://github.com/python/typeshed/tree/main/stubs/qrcode. All fixes for
|
|
26
|
+
types and metadata should be contributed there.
|
|
27
|
+
|
|
28
|
+
See https://github.com/python/typeshed/blob/main/README.md for more details.
|
|
29
|
+
This package was generated from typeshed commit `afe18e95a9592434e93b648de5194cfe54443f84` and was tested
|
|
30
|
+
with mypy 1.4.1, pyright 1.1.318, and
|
|
31
|
+
pytype 2023.6.16.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from qrcode import image as image
|
|
2
|
+
from qrcode.constants import (
|
|
3
|
+
ERROR_CORRECT_H as ERROR_CORRECT_H,
|
|
4
|
+
ERROR_CORRECT_L as ERROR_CORRECT_L,
|
|
5
|
+
ERROR_CORRECT_M as ERROR_CORRECT_M,
|
|
6
|
+
ERROR_CORRECT_Q as ERROR_CORRECT_Q,
|
|
7
|
+
)
|
|
8
|
+
from qrcode.main import make as make
|
|
9
|
+
|
|
10
|
+
def run_example(data: str = "http://www.lincolnloop.com", *args, **kwargs) -> None: ...
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from typing import NamedTuple
|
|
3
|
+
|
|
4
|
+
EXP_TABLE: Incomplete
|
|
5
|
+
LOG_TABLE: Incomplete
|
|
6
|
+
RS_BLOCK_OFFSET: Incomplete
|
|
7
|
+
RS_BLOCK_TABLE: Incomplete
|
|
8
|
+
|
|
9
|
+
def glog(n): ...
|
|
10
|
+
def gexp(n): ...
|
|
11
|
+
|
|
12
|
+
class Polynomial:
|
|
13
|
+
num: Incomplete
|
|
14
|
+
def __init__(self, num, shift) -> None: ...
|
|
15
|
+
def __getitem__(self, index): ...
|
|
16
|
+
def __iter__(self): ...
|
|
17
|
+
def __len__(self) -> int: ...
|
|
18
|
+
def __mul__(self, other): ...
|
|
19
|
+
def __mod__(self, other): ...
|
|
20
|
+
|
|
21
|
+
class RSBlock(NamedTuple):
|
|
22
|
+
total_count: int
|
|
23
|
+
data_count: int
|
|
24
|
+
|
|
25
|
+
def rs_blocks(version, error_correction): ...
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from collections.abc import Iterable
|
|
3
|
+
|
|
4
|
+
from qrcode.image.base import BaseImage, DrawerAliases as DrawerAliases
|
|
5
|
+
|
|
6
|
+
default_factories: Incomplete
|
|
7
|
+
error_correction: Incomplete
|
|
8
|
+
|
|
9
|
+
def main(args: Incomplete | None = None) -> None: ...
|
|
10
|
+
def get_factory(module: str) -> type[BaseImage]: ...
|
|
11
|
+
def get_drawer_help() -> str: ...
|
|
12
|
+
def commas(items: Iterable[str], joiner: str = "or") -> str: ...
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class DataOverflowError(Exception): ...
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from typing import Any
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
5
|
+
|
|
6
|
+
from qrcode.image.styles.moduledrawers.base import QRModuleDrawer
|
|
7
|
+
from qrcode.main import QRCode
|
|
8
|
+
|
|
9
|
+
DrawerAliases: TypeAlias = dict[str, tuple[type[QRModuleDrawer], dict[str, Any]]]
|
|
10
|
+
|
|
11
|
+
class BaseImage(metaclass=abc.ABCMeta):
|
|
12
|
+
kind: str | None
|
|
13
|
+
allowed_kinds: tuple[str] | None
|
|
14
|
+
needs_context: bool
|
|
15
|
+
needs_processing: bool
|
|
16
|
+
needs_drawrect: bool
|
|
17
|
+
border: Incomplete
|
|
18
|
+
width: Incomplete
|
|
19
|
+
box_size: Incomplete
|
|
20
|
+
pixel_size: Incomplete
|
|
21
|
+
modules: Incomplete
|
|
22
|
+
def __init__(self, border, width, box_size, *args, **kwargs) -> None: ...
|
|
23
|
+
@abc.abstractmethod
|
|
24
|
+
def drawrect(self, row, col): ...
|
|
25
|
+
def drawrect_context(self, row: int, col: int, qr: QRCode[Incomplete]): ...
|
|
26
|
+
def process(self) -> None: ...
|
|
27
|
+
@abc.abstractmethod
|
|
28
|
+
def save(self, stream, kind: Incomplete | None = None): ...
|
|
29
|
+
def pixel_box(self, row, col): ...
|
|
30
|
+
@abc.abstractmethod
|
|
31
|
+
def new_image(self, **kwargs) -> Any: ...
|
|
32
|
+
def init_new_image(self) -> None: ...
|
|
33
|
+
def get_image(self, **kwargs): ...
|
|
34
|
+
def check_kind(self, kind, transform: Incomplete | None = None): ...
|
|
35
|
+
def is_eye(self, row: int, col: int): ...
|
|
36
|
+
|
|
37
|
+
class BaseImageWithDrawer(BaseImage, metaclass=abc.ABCMeta):
|
|
38
|
+
default_drawer_class: type[QRModuleDrawer]
|
|
39
|
+
drawer_aliases: DrawerAliases
|
|
40
|
+
def get_default_module_drawer(self) -> QRModuleDrawer: ...
|
|
41
|
+
def get_default_eye_drawer(self) -> QRModuleDrawer: ...
|
|
42
|
+
needs_context: bool
|
|
43
|
+
module_drawer: QRModuleDrawer
|
|
44
|
+
eye_drawer: QRModuleDrawer
|
|
45
|
+
def __init__(
|
|
46
|
+
self, *args, module_drawer: QRModuleDrawer | str | None = None, eye_drawer: QRModuleDrawer | str | None = None, **kwargs
|
|
47
|
+
) -> None: ...
|
|
48
|
+
def get_drawer(self, drawer: QRModuleDrawer | str | None) -> QRModuleDrawer | None: ...
|
|
49
|
+
def init_new_image(self): ...
|
|
50
|
+
def drawrect_context(self, row: int, col: int, qr: QRCode[Incomplete]): ...
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
|
|
3
|
+
import qrcode.image.base
|
|
4
|
+
|
|
5
|
+
class PilImage(qrcode.image.base.BaseImage):
|
|
6
|
+
kind: str
|
|
7
|
+
fill_color: Incomplete
|
|
8
|
+
def new_image(self, **kwargs): ...
|
|
9
|
+
def drawrect(self, row, col) -> None: ...
|
|
10
|
+
def save(self, stream, format: Incomplete | None = None, **kwargs) -> None: ... # type: ignore[override]
|
|
11
|
+
def __getattr__(self, name): ...
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from collections.abc import Generator
|
|
3
|
+
|
|
4
|
+
import qrcode.image.base
|
|
5
|
+
|
|
6
|
+
class PyPNGImage(qrcode.image.base.BaseImage):
|
|
7
|
+
kind: str
|
|
8
|
+
allowed_kinds: Incomplete
|
|
9
|
+
needs_drawrect: bool
|
|
10
|
+
def new_image(self, **kwargs): ...
|
|
11
|
+
def drawrect(self, row, col) -> None: ...
|
|
12
|
+
def save(self, stream, kind: Incomplete | None = None) -> None: ...
|
|
13
|
+
def rows_iter(self) -> Generator[Incomplete, Incomplete, None]: ...
|
|
14
|
+
def border_rows_iter(self) -> Generator[Incomplete, None, None]: ...
|
|
15
|
+
|
|
16
|
+
PymagingImage = PyPNGImage
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
|
|
4
|
+
import qrcode.image.base
|
|
5
|
+
from qrcode.image.styles.colormasks import QRColorMask
|
|
6
|
+
from qrcode.image.styles.moduledrawers import SquareModuleDrawer
|
|
7
|
+
|
|
8
|
+
class StyledPilImage(qrcode.image.base.BaseImageWithDrawer, metaclass=abc.ABCMeta):
|
|
9
|
+
kind: str
|
|
10
|
+
needs_processing: bool
|
|
11
|
+
color_mask: QRColorMask
|
|
12
|
+
default_drawer_class = SquareModuleDrawer
|
|
13
|
+
embeded_image: Incomplete
|
|
14
|
+
embeded_image_resample: Incomplete
|
|
15
|
+
paint_color: Incomplete
|
|
16
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
17
|
+
def new_image(self, **kwargs): ...
|
|
18
|
+
def init_new_image(self) -> None: ...
|
|
19
|
+
def process(self) -> None: ...
|
|
20
|
+
def draw_embeded_image(self) -> None: ...
|
|
21
|
+
def save(self, stream, format: Incomplete | None = None, **kwargs) -> None: ... # type: ignore[override]
|
|
22
|
+
def __getattr__(self, name): ...
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
|
|
3
|
+
class QRColorMask:
|
|
4
|
+
back_color: Incomplete
|
|
5
|
+
has_transparency: bool
|
|
6
|
+
paint_color = back_color
|
|
7
|
+
def initialize(self, styledPilImage, image) -> None: ...
|
|
8
|
+
def apply_mask(self, image) -> None: ...
|
|
9
|
+
def get_fg_pixel(self, image, x, y) -> None: ...
|
|
10
|
+
def get_bg_pixel(self, image, x, y): ...
|
|
11
|
+
def interp_num(self, n1, n2, norm): ...
|
|
12
|
+
def interp_color(self, col1, col2, norm): ...
|
|
13
|
+
def extrap_num(self, n1, n2, interped_num): ...
|
|
14
|
+
def extrap_color(self, col1, col2, interped_color): ...
|
|
15
|
+
|
|
16
|
+
class SolidFillColorMask(QRColorMask):
|
|
17
|
+
back_color: Incomplete
|
|
18
|
+
front_color: Incomplete
|
|
19
|
+
has_transparency: Incomplete
|
|
20
|
+
def __init__(self, back_color=(255, 255, 255), front_color=(0, 0, 0)) -> None: ...
|
|
21
|
+
def apply_mask(self, image) -> None: ...
|
|
22
|
+
def get_fg_pixel(self, image, x, y): ...
|
|
23
|
+
|
|
24
|
+
class RadialGradiantColorMask(QRColorMask):
|
|
25
|
+
back_color: Incomplete
|
|
26
|
+
center_color: Incomplete
|
|
27
|
+
edge_color: Incomplete
|
|
28
|
+
has_transparency: Incomplete
|
|
29
|
+
def __init__(self, back_color=(255, 255, 255), center_color=(0, 0, 0), edge_color=(0, 0, 255)) -> None: ...
|
|
30
|
+
def get_fg_pixel(self, image, x, y): ...
|
|
31
|
+
|
|
32
|
+
class SquareGradiantColorMask(QRColorMask):
|
|
33
|
+
back_color: Incomplete
|
|
34
|
+
center_color: Incomplete
|
|
35
|
+
edge_color: Incomplete
|
|
36
|
+
has_transparency: Incomplete
|
|
37
|
+
def __init__(self, back_color=(255, 255, 255), center_color=(0, 0, 0), edge_color=(0, 0, 255)) -> None: ...
|
|
38
|
+
def get_fg_pixel(self, image, x, y): ...
|
|
39
|
+
|
|
40
|
+
class HorizontalGradiantColorMask(QRColorMask):
|
|
41
|
+
back_color: Incomplete
|
|
42
|
+
left_color: Incomplete
|
|
43
|
+
right_color: Incomplete
|
|
44
|
+
has_transparency: Incomplete
|
|
45
|
+
def __init__(self, back_color=(255, 255, 255), left_color=(0, 0, 0), right_color=(0, 0, 255)) -> None: ...
|
|
46
|
+
def get_fg_pixel(self, image, x, y): ...
|
|
47
|
+
|
|
48
|
+
class VerticalGradiantColorMask(QRColorMask):
|
|
49
|
+
back_color: Incomplete
|
|
50
|
+
top_color: Incomplete
|
|
51
|
+
bottom_color: Incomplete
|
|
52
|
+
has_transparency: Incomplete
|
|
53
|
+
def __init__(self, back_color=(255, 255, 255), top_color=(0, 0, 0), bottom_color=(0, 0, 255)) -> None: ...
|
|
54
|
+
def get_fg_pixel(self, image, x, y): ...
|
|
55
|
+
|
|
56
|
+
class ImageColorMask(QRColorMask):
|
|
57
|
+
back_color: Incomplete
|
|
58
|
+
color_img: Incomplete
|
|
59
|
+
has_transparency: Incomplete
|
|
60
|
+
def __init__(
|
|
61
|
+
self, back_color=(255, 255, 255), color_mask_path: Incomplete | None = None, color_mask_image: Incomplete | None = None
|
|
62
|
+
) -> None: ...
|
|
63
|
+
paint_color: Incomplete
|
|
64
|
+
def initialize(self, styledPilImage, image) -> None: ...
|
|
65
|
+
def get_fg_pixel(self, image, x, y): ...
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from .pil import (
|
|
2
|
+
CircleModuleDrawer as CircleModuleDrawer,
|
|
3
|
+
GappedSquareModuleDrawer as GappedSquareModuleDrawer,
|
|
4
|
+
HorizontalBarsDrawer as HorizontalBarsDrawer,
|
|
5
|
+
RoundedModuleDrawer as RoundedModuleDrawer,
|
|
6
|
+
SquareModuleDrawer as SquareModuleDrawer,
|
|
7
|
+
VerticalBarsDrawer as VerticalBarsDrawer,
|
|
8
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
|
|
4
|
+
from qrcode.image.base import BaseImage
|
|
5
|
+
|
|
6
|
+
class QRModuleDrawer(abc.ABC, metaclass=abc.ABCMeta):
|
|
7
|
+
needs_neighbors: bool
|
|
8
|
+
def __init__(self, **kwargs) -> None: ...
|
|
9
|
+
img: Incomplete
|
|
10
|
+
def initialize(self, img: BaseImage) -> None: ...
|
|
11
|
+
@abc.abstractmethod
|
|
12
|
+
def drawrect(self, box, is_active) -> None: ...
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
|
|
4
|
+
from qrcode.image.styledpil import StyledPilImage
|
|
5
|
+
from qrcode.image.styles.moduledrawers.base import QRModuleDrawer
|
|
6
|
+
from qrcode.main import ActiveWithNeighbors
|
|
7
|
+
|
|
8
|
+
ANTIALIASING_FACTOR: int
|
|
9
|
+
|
|
10
|
+
class StyledPilQRModuleDrawer(QRModuleDrawer, metaclass=abc.ABCMeta):
|
|
11
|
+
img: StyledPilImage
|
|
12
|
+
|
|
13
|
+
class SquareModuleDrawer(StyledPilQRModuleDrawer):
|
|
14
|
+
imgDraw: Incomplete
|
|
15
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
16
|
+
def drawrect(self, box, is_active: bool): ...
|
|
17
|
+
|
|
18
|
+
class GappedSquareModuleDrawer(StyledPilQRModuleDrawer):
|
|
19
|
+
size_ratio: Incomplete
|
|
20
|
+
def __init__(self, size_ratio: float = 0.8) -> None: ...
|
|
21
|
+
imgDraw: Incomplete
|
|
22
|
+
delta: Incomplete
|
|
23
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
24
|
+
def drawrect(self, box, is_active: bool): ...
|
|
25
|
+
|
|
26
|
+
class CircleModuleDrawer(StyledPilQRModuleDrawer):
|
|
27
|
+
circle: Incomplete
|
|
28
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
29
|
+
def drawrect(self, box, is_active: bool): ...
|
|
30
|
+
|
|
31
|
+
class RoundedModuleDrawer(StyledPilQRModuleDrawer):
|
|
32
|
+
needs_neighbors: bool
|
|
33
|
+
radius_ratio: Incomplete
|
|
34
|
+
def __init__(self, radius_ratio: int = 1) -> None: ...
|
|
35
|
+
corner_width: Incomplete
|
|
36
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
37
|
+
SQUARE: Incomplete
|
|
38
|
+
NW_ROUND: Incomplete
|
|
39
|
+
SW_ROUND: Incomplete
|
|
40
|
+
SE_ROUND: Incomplete
|
|
41
|
+
NE_ROUND: Incomplete
|
|
42
|
+
def setup_corners(self) -> None: ...
|
|
43
|
+
def drawrect(self, box: list[list[int]], is_active: ActiveWithNeighbors): ...
|
|
44
|
+
|
|
45
|
+
class VerticalBarsDrawer(StyledPilQRModuleDrawer):
|
|
46
|
+
needs_neighbors: bool
|
|
47
|
+
horizontal_shrink: Incomplete
|
|
48
|
+
def __init__(self, horizontal_shrink: float = 0.8) -> None: ...
|
|
49
|
+
half_height: Incomplete
|
|
50
|
+
delta: Incomplete
|
|
51
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
52
|
+
SQUARE: Incomplete
|
|
53
|
+
ROUND_TOP: Incomplete
|
|
54
|
+
ROUND_BOTTOM: Incomplete
|
|
55
|
+
def setup_edges(self) -> None: ...
|
|
56
|
+
def drawrect(self, box, is_active: ActiveWithNeighbors): ...
|
|
57
|
+
|
|
58
|
+
class HorizontalBarsDrawer(StyledPilQRModuleDrawer):
|
|
59
|
+
needs_neighbors: bool
|
|
60
|
+
vertical_shrink: Incomplete
|
|
61
|
+
def __init__(self, vertical_shrink: float = 0.8) -> None: ...
|
|
62
|
+
half_width: Incomplete
|
|
63
|
+
delta: Incomplete
|
|
64
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
65
|
+
SQUARE: Incomplete
|
|
66
|
+
ROUND_LEFT: Incomplete
|
|
67
|
+
ROUND_RIGHT: Incomplete
|
|
68
|
+
def setup_edges(self) -> None: ...
|
|
69
|
+
def drawrect(self, box, is_active: ActiveWithNeighbors): ...
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from decimal import Decimal
|
|
4
|
+
from typing import NamedTuple
|
|
5
|
+
|
|
6
|
+
from qrcode.image.styles.moduledrawers.base import QRModuleDrawer
|
|
7
|
+
from qrcode.image.svg import SvgFragmentImage, SvgPathImage
|
|
8
|
+
|
|
9
|
+
ANTIALIASING_FACTOR: int
|
|
10
|
+
|
|
11
|
+
class Coords(NamedTuple):
|
|
12
|
+
x0: Decimal
|
|
13
|
+
y0: Decimal
|
|
14
|
+
x1: Decimal
|
|
15
|
+
y1: Decimal
|
|
16
|
+
xh: Decimal
|
|
17
|
+
yh: Decimal
|
|
18
|
+
|
|
19
|
+
class BaseSvgQRModuleDrawer(QRModuleDrawer, metaclass=abc.ABCMeta):
|
|
20
|
+
img: SvgFragmentImage
|
|
21
|
+
size_ratio: Incomplete
|
|
22
|
+
def __init__(self, *, size_ratio: Decimal = ..., **kwargs) -> None: ...
|
|
23
|
+
box_delta: Incomplete
|
|
24
|
+
box_size: Incomplete
|
|
25
|
+
box_half: Incomplete
|
|
26
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
27
|
+
def coords(self, box) -> Coords: ...
|
|
28
|
+
|
|
29
|
+
class SvgQRModuleDrawer(BaseSvgQRModuleDrawer, metaclass=abc.ABCMeta):
|
|
30
|
+
tag: str
|
|
31
|
+
tag_qname: Incomplete
|
|
32
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
33
|
+
def drawrect(self, box, is_active: bool): ...
|
|
34
|
+
@abc.abstractmethod
|
|
35
|
+
def el(self, box): ...
|
|
36
|
+
|
|
37
|
+
class SvgSquareDrawer(SvgQRModuleDrawer):
|
|
38
|
+
unit_size: Incomplete
|
|
39
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
40
|
+
def el(self, box): ...
|
|
41
|
+
|
|
42
|
+
class SvgCircleDrawer(SvgQRModuleDrawer):
|
|
43
|
+
tag: str
|
|
44
|
+
radius: Incomplete
|
|
45
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
46
|
+
def el(self, box): ...
|
|
47
|
+
|
|
48
|
+
class SvgPathQRModuleDrawer(BaseSvgQRModuleDrawer, metaclass=abc.ABCMeta):
|
|
49
|
+
img: SvgPathImage
|
|
50
|
+
def drawrect(self, box, is_active: bool): ...
|
|
51
|
+
@abc.abstractmethod
|
|
52
|
+
def subpath(self, box) -> str: ...
|
|
53
|
+
|
|
54
|
+
class SvgPathSquareDrawer(SvgPathQRModuleDrawer):
|
|
55
|
+
def subpath(self, box) -> str: ...
|
|
56
|
+
|
|
57
|
+
class SvgPathCircleDrawer(SvgPathQRModuleDrawer):
|
|
58
|
+
def initialize(self, *args, **kwargs) -> None: ...
|
|
59
|
+
def subpath(self, box) -> str: ...
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
from decimal import Decimal
|
|
4
|
+
from typing import overload
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
from xml.etree.ElementTree import Element
|
|
7
|
+
|
|
8
|
+
import qrcode.image.base
|
|
9
|
+
from qrcode.image.styles.moduledrawers.base import QRModuleDrawer
|
|
10
|
+
|
|
11
|
+
class SvgFragmentImage(qrcode.image.base.BaseImageWithDrawer, metaclass=abc.ABCMeta):
|
|
12
|
+
kind: str
|
|
13
|
+
allowed_kinds: Incomplete
|
|
14
|
+
default_drawer_class: type[QRModuleDrawer]
|
|
15
|
+
unit_size: Incomplete
|
|
16
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
17
|
+
@overload
|
|
18
|
+
def units(self, pixels: int | Decimal, text: Literal[False]) -> Decimal: ...
|
|
19
|
+
@overload
|
|
20
|
+
def units(self, pixels: int | Decimal, text: Literal[True] = True) -> str: ...
|
|
21
|
+
def save(self, stream, kind: Incomplete | None = None) -> None: ...
|
|
22
|
+
def to_string(self, **kwargs): ...
|
|
23
|
+
def new_image(self, **kwargs): ...
|
|
24
|
+
|
|
25
|
+
class SvgImage(SvgFragmentImage, metaclass=abc.ABCMeta):
|
|
26
|
+
background: str | None
|
|
27
|
+
drawer_aliases: qrcode.image.base.DrawerAliases
|
|
28
|
+
|
|
29
|
+
class SvgPathImage(SvgImage, metaclass=abc.ABCMeta):
|
|
30
|
+
QR_PATH_STYLE: Incomplete
|
|
31
|
+
needs_processing: bool
|
|
32
|
+
path: Element | None
|
|
33
|
+
default_drawer_class: type[QRModuleDrawer]
|
|
34
|
+
drawer_aliases: Incomplete
|
|
35
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
36
|
+
def process(self) -> None: ...
|
|
37
|
+
|
|
38
|
+
class SvgFillImage(SvgImage, metaclass=abc.ABCMeta):
|
|
39
|
+
background: str
|
|
40
|
+
|
|
41
|
+
class SvgPathFillImage(SvgPathImage, metaclass=abc.ABCMeta):
|
|
42
|
+
background: str
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from typing import Generic, NamedTuple, TypeVar, overload
|
|
3
|
+
from typing_extensions import Literal, TypeAlias
|
|
4
|
+
|
|
5
|
+
from qrcode.image.base import BaseImage
|
|
6
|
+
|
|
7
|
+
ModulesType: TypeAlias = list[list[bool | None]]
|
|
8
|
+
precomputed_qr_blanks: dict[int, ModulesType]
|
|
9
|
+
|
|
10
|
+
def make(data: Incomplete | None = None, **kwargs): ...
|
|
11
|
+
def copy_2d_array(x): ...
|
|
12
|
+
|
|
13
|
+
class ActiveWithNeighbors(NamedTuple):
|
|
14
|
+
NW: bool
|
|
15
|
+
N: bool
|
|
16
|
+
NE: bool
|
|
17
|
+
W: bool
|
|
18
|
+
me: bool
|
|
19
|
+
E: bool
|
|
20
|
+
SW: bool
|
|
21
|
+
S: bool
|
|
22
|
+
SE: bool
|
|
23
|
+
def __bool__(self) -> bool: ...
|
|
24
|
+
|
|
25
|
+
GenericImage = TypeVar("GenericImage", bound=BaseImage) # noqa: Y001
|
|
26
|
+
GenericImageLocal = TypeVar("GenericImageLocal", bound=BaseImage) # noqa: Y001
|
|
27
|
+
|
|
28
|
+
class QRCode(Generic[GenericImage]):
|
|
29
|
+
modules: ModulesType
|
|
30
|
+
error_correction: Incomplete
|
|
31
|
+
box_size: Incomplete
|
|
32
|
+
border: Incomplete
|
|
33
|
+
image_factory: Incomplete
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
version: Incomplete | None = None,
|
|
37
|
+
error_correction=0,
|
|
38
|
+
box_size: int = 10,
|
|
39
|
+
border: int = 4,
|
|
40
|
+
image_factory: type[GenericImage] | None = None,
|
|
41
|
+
mask_pattern: Incomplete | None = None,
|
|
42
|
+
) -> None: ...
|
|
43
|
+
@property
|
|
44
|
+
def version(self) -> int: ...
|
|
45
|
+
@property
|
|
46
|
+
def mask_pattern(self): ...
|
|
47
|
+
modules_count: int
|
|
48
|
+
data_cache: Incomplete
|
|
49
|
+
data_list: Incomplete
|
|
50
|
+
def clear(self) -> None: ...
|
|
51
|
+
def add_data(self, data, optimize: int = 20) -> None: ...
|
|
52
|
+
def make(self, fit: bool = True) -> None: ...
|
|
53
|
+
def makeImpl(self, test, mask_pattern) -> None: ...
|
|
54
|
+
def setup_position_probe_pattern(self, row, col) -> None: ...
|
|
55
|
+
def best_fit(self, start: Incomplete | None = None): ...
|
|
56
|
+
def best_mask_pattern(self): ...
|
|
57
|
+
def print_tty(self, out: Incomplete | None = None) -> None: ...
|
|
58
|
+
def print_ascii(self, out: Incomplete | None = None, tty: bool = False, invert: bool = False): ...
|
|
59
|
+
@overload
|
|
60
|
+
def make_image(self, image_factory: Literal[None] = None, **kwargs) -> GenericImage: ...
|
|
61
|
+
@overload
|
|
62
|
+
def make_image(self, image_factory: type[GenericImageLocal] | None = None, **kwargs) -> GenericImageLocal: ...
|
|
63
|
+
def is_constrained(self, row: int, col: int) -> bool: ...
|
|
64
|
+
def setup_timing_pattern(self) -> None: ...
|
|
65
|
+
def setup_position_adjust_pattern(self) -> None: ...
|
|
66
|
+
def setup_type_number(self, test) -> None: ...
|
|
67
|
+
def setup_type_info(self, test, mask_pattern) -> None: ...
|
|
68
|
+
def map_data(self, data, mask_pattern) -> None: ...
|
|
69
|
+
def get_matrix(self): ...
|
|
70
|
+
def active_with_neighbors(self, row: int, col: int) -> ActiveWithNeighbors: ...
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
def update_manpage(data) -> None: ...
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from collections.abc import Generator
|
|
3
|
+
|
|
4
|
+
from qrcode.base import RSBlock as RSBlock
|
|
5
|
+
|
|
6
|
+
MODE_NUMBER: Incomplete
|
|
7
|
+
MODE_ALPHA_NUM: Incomplete
|
|
8
|
+
MODE_8BIT_BYTE: Incomplete
|
|
9
|
+
MODE_KANJI: Incomplete
|
|
10
|
+
MODE_SIZE_SMALL: Incomplete
|
|
11
|
+
MODE_SIZE_MEDIUM: Incomplete
|
|
12
|
+
MODE_SIZE_LARGE: Incomplete
|
|
13
|
+
ALPHA_NUM: bytes
|
|
14
|
+
RE_ALPHA_NUM: Incomplete
|
|
15
|
+
NUMBER_LENGTH: Incomplete
|
|
16
|
+
PATTERN_POSITION_TABLE: Incomplete
|
|
17
|
+
G15: Incomplete
|
|
18
|
+
G18: Incomplete
|
|
19
|
+
G15_MASK: Incomplete
|
|
20
|
+
PAD0: int
|
|
21
|
+
PAD1: int
|
|
22
|
+
BIT_LIMIT_TABLE: Incomplete
|
|
23
|
+
|
|
24
|
+
def BCH_type_info(data): ...
|
|
25
|
+
def BCH_type_number(data): ...
|
|
26
|
+
def BCH_digit(data): ...
|
|
27
|
+
def pattern_position(version): ...
|
|
28
|
+
def mask_func(pattern): ...
|
|
29
|
+
def mode_sizes_for_version(version): ...
|
|
30
|
+
def length_in_bits(mode, version): ...
|
|
31
|
+
def check_version(version) -> None: ...
|
|
32
|
+
def lost_point(modules): ...
|
|
33
|
+
def optimal_data_chunks(data, minimum: int = 4) -> Generator[Incomplete, None, None]: ...
|
|
34
|
+
def to_bytestring(data): ...
|
|
35
|
+
def optimal_mode(data): ...
|
|
36
|
+
|
|
37
|
+
class QRData:
|
|
38
|
+
mode: Incomplete
|
|
39
|
+
data: Incomplete
|
|
40
|
+
def __init__(self, data, mode: Incomplete | None = None, check_data: bool = True) -> None: ...
|
|
41
|
+
def __len__(self) -> int: ...
|
|
42
|
+
def write(self, buffer) -> None: ...
|
|
43
|
+
|
|
44
|
+
class BitBuffer:
|
|
45
|
+
buffer: Incomplete
|
|
46
|
+
length: int
|
|
47
|
+
def __init__(self) -> None: ...
|
|
48
|
+
def get(self, index): ...
|
|
49
|
+
def put(self, num, length) -> None: ...
|
|
50
|
+
def __len__(self) -> int: ...
|
|
51
|
+
def put_bit(self, bit) -> None: ...
|
|
52
|
+
|
|
53
|
+
def create_bytes(buffer: BitBuffer, rs_blocks: list[RSBlock]): ...
|
|
54
|
+
def create_data(version, error_correction, data_list): ...
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
name = "types-qrcode"
|
|
4
|
+
description = "Typing stubs for qrcode"
|
|
5
|
+
long_description = '''
|
|
6
|
+
## Typing stubs for qrcode
|
|
7
|
+
|
|
8
|
+
This is a PEP 561 type stub package for the `qrcode` package. It
|
|
9
|
+
can be used by type-checking tools like
|
|
10
|
+
[mypy](https://github.com/python/mypy/),
|
|
11
|
+
[pyright](https://github.com/microsoft/pyright),
|
|
12
|
+
[pytype](https://github.com/google/pytype/),
|
|
13
|
+
PyCharm, etc. to check code that uses
|
|
14
|
+
`qrcode`. The source for this package can be found at
|
|
15
|
+
https://github.com/python/typeshed/tree/main/stubs/qrcode. All fixes for
|
|
16
|
+
types and metadata should be contributed there.
|
|
17
|
+
|
|
18
|
+
See https://github.com/python/typeshed/blob/main/README.md for more details.
|
|
19
|
+
This package was generated from typeshed commit `afe18e95a9592434e93b648de5194cfe54443f84` and was tested
|
|
20
|
+
with mypy 1.4.1, pyright 1.1.318, and
|
|
21
|
+
pytype 2023.6.16.
|
|
22
|
+
'''.lstrip()
|
|
23
|
+
|
|
24
|
+
setup(name=name,
|
|
25
|
+
version="7.4.0.0",
|
|
26
|
+
description=description,
|
|
27
|
+
long_description=long_description,
|
|
28
|
+
long_description_content_type="text/markdown",
|
|
29
|
+
url="https://github.com/python/typeshed",
|
|
30
|
+
project_urls={
|
|
31
|
+
"GitHub": "https://github.com/python/typeshed",
|
|
32
|
+
"Changes": "https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/qrcode.md",
|
|
33
|
+
"Issue tracker": "https://github.com/python/typeshed/issues",
|
|
34
|
+
"Chat": "https://gitter.im/python/typing",
|
|
35
|
+
},
|
|
36
|
+
install_requires=[],
|
|
37
|
+
packages=['qrcode-stubs'],
|
|
38
|
+
package_data={'qrcode-stubs': ['LUT.pyi', '__init__.pyi', 'base.pyi', 'console_scripts.pyi', 'constants.pyi', 'exceptions.pyi', 'image/__init__.pyi', 'image/base.pyi', 'image/pil.pyi', 'image/pure.pyi', 'image/styledpil.pyi', 'image/styles/__init__.pyi', 'image/styles/colormasks.pyi', 'image/styles/moduledrawers/__init__.pyi', 'image/styles/moduledrawers/base.pyi', 'image/styles/moduledrawers/pil.pyi', 'image/styles/moduledrawers/svg.pyi', 'image/svg.pyi', 'main.pyi', 'release.pyi', 'util.pyi', 'METADATA.toml']},
|
|
39
|
+
license="Apache-2.0 license",
|
|
40
|
+
classifiers=[
|
|
41
|
+
"License :: OSI Approved :: Apache Software License",
|
|
42
|
+
"Programming Language :: Python :: 3",
|
|
43
|
+
"Typing :: Stubs Only",
|
|
44
|
+
]
|
|
45
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: types-qrcode
|
|
3
|
+
Version: 7.4.0.0
|
|
4
|
+
Summary: Typing stubs for qrcode
|
|
5
|
+
Home-page: https://github.com/python/typeshed
|
|
6
|
+
License: Apache-2.0 license
|
|
7
|
+
Project-URL: GitHub, https://github.com/python/typeshed
|
|
8
|
+
Project-URL: Changes, https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/qrcode.md
|
|
9
|
+
Project-URL: Issue tracker, https://github.com/python/typeshed/issues
|
|
10
|
+
Project-URL: Chat, https://gitter.im/python/typing
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Typing :: Stubs Only
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
## Typing stubs for qrcode
|
|
17
|
+
|
|
18
|
+
This is a PEP 561 type stub package for the `qrcode` package. It
|
|
19
|
+
can be used by type-checking tools like
|
|
20
|
+
[mypy](https://github.com/python/mypy/),
|
|
21
|
+
[pyright](https://github.com/microsoft/pyright),
|
|
22
|
+
[pytype](https://github.com/google/pytype/),
|
|
23
|
+
PyCharm, etc. to check code that uses
|
|
24
|
+
`qrcode`. The source for this package can be found at
|
|
25
|
+
https://github.com/python/typeshed/tree/main/stubs/qrcode. All fixes for
|
|
26
|
+
types and metadata should be contributed there.
|
|
27
|
+
|
|
28
|
+
See https://github.com/python/typeshed/blob/main/README.md for more details.
|
|
29
|
+
This package was generated from typeshed commit `afe18e95a9592434e93b648de5194cfe54443f84` and was tested
|
|
30
|
+
with mypy 1.4.1, pyright 1.1.318, and
|
|
31
|
+
pytype 2023.6.16.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
CHANGELOG.md
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
setup.py
|
|
4
|
+
qrcode-stubs/LUT.pyi
|
|
5
|
+
qrcode-stubs/METADATA.toml
|
|
6
|
+
qrcode-stubs/__init__.pyi
|
|
7
|
+
qrcode-stubs/base.pyi
|
|
8
|
+
qrcode-stubs/console_scripts.pyi
|
|
9
|
+
qrcode-stubs/constants.pyi
|
|
10
|
+
qrcode-stubs/exceptions.pyi
|
|
11
|
+
qrcode-stubs/main.pyi
|
|
12
|
+
qrcode-stubs/release.pyi
|
|
13
|
+
qrcode-stubs/util.pyi
|
|
14
|
+
qrcode-stubs/image/__init__.pyi
|
|
15
|
+
qrcode-stubs/image/base.pyi
|
|
16
|
+
qrcode-stubs/image/pil.pyi
|
|
17
|
+
qrcode-stubs/image/pure.pyi
|
|
18
|
+
qrcode-stubs/image/styledpil.pyi
|
|
19
|
+
qrcode-stubs/image/svg.pyi
|
|
20
|
+
qrcode-stubs/image/styles/__init__.pyi
|
|
21
|
+
qrcode-stubs/image/styles/colormasks.pyi
|
|
22
|
+
qrcode-stubs/image/styles/moduledrawers/__init__.pyi
|
|
23
|
+
qrcode-stubs/image/styles/moduledrawers/base.pyi
|
|
24
|
+
qrcode-stubs/image/styles/moduledrawers/pil.pyi
|
|
25
|
+
qrcode-stubs/image/styles/moduledrawers/svg.pyi
|
|
26
|
+
types_qrcode.egg-info/PKG-INFO
|
|
27
|
+
types_qrcode.egg-info/SOURCES.txt
|
|
28
|
+
types_qrcode.egg-info/dependency_links.txt
|
|
29
|
+
types_qrcode.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
qrcode-stubs
|