-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8b5ff6
commit 1ce63b4
Showing
5 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[mypy] | ||
mypy_path = stubs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__version__ = "0.1.0" | ||
|
||
from .uuid7 import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
__all__ = ( | ||
"uuid7", | ||
"uuid7str", | ||
"time_ns", | ||
"check_timing_precision", | ||
"uuid_to_datetime", | ||
) | ||
|
||
import datetime | ||
import time | ||
import uuid | ||
from typing import Callable, Optional, Union | ||
|
||
time_ns = time.time_ns | ||
|
||
def uuid7( | ||
ns: Optional[int] = None, | ||
as_type: Optional[str] = None, | ||
time_func: Callable[[], int] = time_ns, | ||
_last=[0, 0, 0, 0], | ||
_last_as_of=[0, 0, 0, 0], | ||
) -> Union[uuid.UUID, str, int, bytes]: ... | ||
def uuid7str(ns: Optional[int] = None) -> str: ... | ||
def check_timing_precision( | ||
timing_func: Optional[Callable[[], int]] = None, | ||
) -> str: ... | ||
def uuid_to_datetime( | ||
s: Union[str, uuid.UUID, int], | ||
suppress_error=True, | ||
) -> Optional[datetime.datetime]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters