Skip to content

Commit 5e1632b

Browse files
kasiumAlexWaygood
andauthored
Add stubs for python-datemath (#5765)
Co-authored-by: Alex Waygood <[email protected]>
1 parent e2d67bf commit 5e1632b

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version = "1.5.*"
2+
# Requires a version of arrow with a `py.typed` file
3+
requires = ["arrow>=1.0.1"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from datetime import datetime
2+
3+
import arrow
4+
5+
from .helpers import DateMathException as DateMathException, parse as parse
6+
7+
def dm(
8+
expr: str, *, now: arrow.Arrow | None = ..., tz: str = ..., type: str | None = ..., roundDown: bool = ...
9+
) -> arrow.Arrow: ...
10+
def datemath(
11+
expr: str, *, now: arrow.Arrow | None = ..., tz: str = ..., type: str | None = ..., roundDown: bool = ...
12+
) -> datetime: ...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from _typeshed import Incomplete
2+
3+
import arrow
4+
5+
class DateMathException(Exception): ...
6+
7+
def parse(
8+
expression: str, now: arrow.Arrow | None = ..., tz: str = ..., type: str | None = ..., roundDown: bool = ...
9+
) -> arrow.Arrow: ...
10+
def __getattr__(name: str) -> Incomplete: ...

0 commit comments

Comments
 (0)