Skip to content

Commit ffb7e22

Browse files
committed
Contribute stubs for datauri==1.0.0
https://github.com/eclecticiq/python-data-uri is a small library implementing parsing of the data: uri scheme defined in RFC2397. Library still supported python 3.3, and lacks any inline type comments. Library is stable and works fine in python 3.14.
1 parent 9c00c6e commit ffb7e22

File tree

3 files changed

+23
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)