Skip to content

Commit ba6bdc6

Browse files
authored
[convertdate] Add stubs (#14646)
1 parent dede8bc commit ba6bdc6

24 files changed

+600
-0
lines changed

stubs/convertdate/METADATA.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version = "2.4.*"
2+
upstream_repository = "https://github.com/fitnr/convertdate"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from typing import Final
2+
3+
from . import (
4+
armenian as armenian,
5+
bahai as bahai,
6+
coptic as coptic,
7+
daycount as daycount,
8+
dublin as dublin,
9+
french_republican as french_republican,
10+
gregorian as gregorian,
11+
hebrew as hebrew,
12+
holidays as holidays,
13+
indian_civil as indian_civil,
14+
islamic as islamic,
15+
iso as iso,
16+
julian as julian,
17+
julianday as julianday,
18+
mayan as mayan,
19+
ordinal as ordinal,
20+
persian as persian,
21+
positivist as positivist,
22+
utils as utils,
23+
)
24+
25+
__version__: Final[str]
26+
27+
__all__ = [
28+
"holidays",
29+
"armenian",
30+
"bahai",
31+
"coptic",
32+
"dublin",
33+
"daycount",
34+
"french_republican",
35+
"gregorian",
36+
"hebrew",
37+
"indian_civil",
38+
"islamic",
39+
"iso",
40+
"julian",
41+
"julianday",
42+
"mayan",
43+
"persian",
44+
"positivist",
45+
"mayan",
46+
"ordinal",
47+
"utils",
48+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from typing import Final, Literal
2+
3+
EPOCH: Final = 1922501.5
4+
EPOCH_SARKAWAG: Final = 2117210.5
5+
MONTHS: Final[list[str]]
6+
MONTHS_ARM: Final[list[str]]
7+
8+
def leap(year: int) -> bool: ...
9+
def to_jd(year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None) -> float: ...
10+
def from_jd(jd: float, method: Literal["sarkawag", "moveable"] | None = None) -> tuple[int, int, int]: ...
11+
def to_julian(year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None) -> tuple[int, int, int]: ...
12+
def from_julian(
13+
year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None
14+
) -> tuple[int, int, int]: ...
15+
def to_gregorian(
16+
year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None
17+
) -> tuple[int, int, int]: ...
18+
def from_gregorian(
19+
year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None
20+
) -> tuple[int, int, int]: ...
21+
def month_length(year: int, month: int, method: Literal["sarkawag", "moveable"] | None = None) -> Literal[5, 6, 30]: ...
22+
def monthcalendar(year: int, month: int, method: Literal["sarkawag", "moveable"] | None = None) -> list[list[int | None]]: ...
23+
def format(year: int, month: int, day: int, lang: str | None = None) -> str: ...
24+
def tostring(year: int, month: int, day: int, lang: str | None = None) -> str: ...
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from typing import Final
2+
3+
EPOCH: Final = 2394646.5
4+
EPOCH_GREGORIAN_YEAR: Final = 1844
5+
TEHRAN: Final = 51.4215, 35.6944
6+
WEEKDAYS: Final = ("Jamál", "Kamál", "Fidál", "Idál", "Istijlál", "Istiqlál", "Jalál")
7+
MONTHS: Final[tuple[str, ...]]
8+
ENGLISH_MONTHS: Final[tuple[str, ...]]
9+
BAHA: Final = 1
10+
JALAL: Final = 2
11+
JAMAL: Final = 3
12+
AZAMAT: Final = 4
13+
NUR: Final = 5
14+
RAHMAT: Final = 6
15+
KALIMAT: Final = 7
16+
KAMAL: Final = 8
17+
ASMA: Final = 9
18+
IZZAT: Final = 10
19+
MASHIYYAT: Final = 11
20+
ILM: Final = 12
21+
QUDRAT: Final = 13
22+
QAWL: Final = 14
23+
MASAIL: Final = 15
24+
SHARAF: Final = 16
25+
SULTAN: Final = 17
26+
MULK: Final = 18
27+
AYYAMIHA: Final = 19
28+
ALA: Final = 20
29+
30+
def gregorian_nawruz(year: int) -> tuple[int, int]: ...
31+
def to_jd(year: int, month: int, day: int) -> float: ...
32+
def from_jd(jd: float) -> tuple[int, int, int]: ...
33+
def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ...
34+
def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ...
35+
def month_length(year: int, month: int) -> int: ...
36+
def monthcalendar(year: int, month: int) -> list[list[int | None]]: ...
37+
def format(year: int, month: int, day: int, lang: str | None = None) -> str: ...
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import Final, Literal
2+
3+
EPOCH: Final = 1825029.5
4+
MONTHS: Final[list[str]]
5+
WEEKDAYS: Final = ["Tkyriaka", "Pesnau", "Pshoment", "Peftoou", "Ptiou", "Psoou", "Psabbaton"]
6+
7+
def is_leap(year: int) -> bool: ...
8+
def to_jd(year: int, month: int, day: int) -> float: ...
9+
def from_jd(jdc: float) -> tuple[int, int, int]: ...
10+
def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ...
11+
def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ...
12+
def month_length(year: int, month: int) -> Literal[5, 6, 30]: ...
13+
def monthcalendar(year: int, month: int) -> list[list[int | None]]: ...
14+
def format(year: int, month: int, day: int) -> str: ...

stubs/convertdate/convertdate/data/__init__.pyi

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from typing import Final
2+
3+
french_republican_days: Final[dict[int, list[str]]]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from typing import Final
2+
3+
DAY_NAMES: Final[tuple[str, ...]]
4+
leap_day_replacements: Final[dict[int, str]]
5+
DAY_NAMES_LEAP: Final[list[str]]
6+
FESTIVALS: Final[dict[tuple[int, int], str]]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import datetime
2+
3+
class DayCount:
4+
epoch: float
5+
def __init__(self, epoch: float) -> None: ...
6+
def to_gregorian(self, dc: int) -> tuple[int, int, int]: ...
7+
def from_gregorian(self, year: int, month: int, day: int) -> float: ...
8+
def to_jd(self, dc: int) -> float: ...
9+
def from_jd(self, jdc: float) -> float: ...
10+
def from_julian(self, year: int, month: int, day: int) -> float: ...
11+
def to_julian(self, dc: int) -> tuple[int, int, int]: ...
12+
def to_datetime(self, dc: int) -> datetime.datetime: ...
13+
def from_datetime(self, date: datetime.datetime) -> float: ...
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import datetime
2+
from typing import Final
3+
4+
EPOCH: Final = 2415020
5+
6+
def to_gregorian(dc: int) -> tuple[int, int, int]: ...
7+
def from_gregorian(year: int, month: int, day: int) -> float: ...
8+
def to_jd(dc: int) -> float: ...
9+
def from_jd(jdc: float) -> float: ...
10+
def from_julian(year: int, month: int, day: int) -> float: ...
11+
def to_julian(dc: int) -> tuple[int, int, int]: ...
12+
def to_datetime(dc: int) -> datetime.datetime: ...
13+
def from_datetime(date: datetime.datetime) -> float: ...

0 commit comments

Comments
 (0)