Skip to content

Commit 944838f

Browse files
authored
Add stubs for datauri
1 parent 12944d1 commit 944838f

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

stubs/datauri/METADATA.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version = "1.1.*"
2+
upstream_repository = "https://github.com/eclecticiq/python-data-uri"

stubs/datauri/datauri/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .datauri import DataURIError as DataURIError, discover as discover, parse as parse

stubs/datauri/datauri/datauri.pyi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from collections.abc import Generator
2+
from re import Pattern
3+
from typing import Final
4+
5+
RE_DATA_URI: Final[Pattern[str]] # undocumented
6+
7+
class DataURIError(ValueError): ...
8+
9+
class ParsedDataURI:
10+
media_type: str | None
11+
data: bytes
12+
uri: str
13+
14+
def __init__(self, media_type: str | None, data: bytes, uri: str) -> None: ...
15+
def __eq__(self, other: object) -> bool: ...
16+
def __hash__(self) -> int: ...
17+
18+
def parse(uri: str) -> ParsedDataURI: ...
19+
def discover(s: str) -> Generator[ParsedDataURI]: ...

0 commit comments

Comments
 (0)