0.14.0a2 fix import order, add snowflake epoch values

This commit is contained in:
Yusur 2026-07-03 09:44:04 +02:00
parent 4aefac0e99
commit e2aec01d31
4 changed files with 16 additions and 6 deletions

View file

@ -5,6 +5,7 @@
* Added `ast` module
* Deprecate `dei_args()` for problems with the typing system. The function is not going away tho
* Module `sqlalchemy`: added `email_column()`
* Added common values for snowflake epoch in `SnowflakeEpoch` enum
## 0.13.1 and 0.12.7

View file

@ -16,6 +16,7 @@ This software is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
from .functools import deprecated, not_implemented, timed_cache, none_pass, alru_cache, future, cooldown, do_not_flood
from .iding import Siq, SiqCache, SiqType, SiqGen
from .codecs import (StringCase, cb32encode, cb32decode, b32lencode, b32ldecode, b64encode, b64decode, b2048encode, b2048decode,
jsonencode, twocolon_list, want_bytes, want_str, ssv_list, want_urlsafe, want_urlsafe_bytes,
@ -25,12 +26,11 @@ from .calendar import want_datetime, want_isodate, want_timestamp, age_and_days
from .configparse import MissingConfigError, MissingConfigWarning, ConfigOptions, ConfigParserConfigSource, ConfigSource, DictConfigSource, ConfigValue, EnvConfigSource
from .collections import TimedDict
from .dei import dei_args
from .functools import deprecated, not_implemented, timed_cache, none_pass, alru_cache, future, cooldown, do_not_flood
from .classtools import Wanted, Incomplete
from .itertools import makelist, kwargs_prefix, ltuple, rtuple, additem, addattr
from .i18n import I18n, JsonI18n, TomlI18n
from .signing import UserSigner
from .snowflake import Snowflake, SnowflakeGen
from .snowflake import Snowflake, SnowflakeEpoch, SnowflakeGen
from .lex import symbol_table, lex, ilex
from .strtools import PrefixIdentifier
from .validators import matches, not_less_than, not_greater_than, yesno, must_be
@ -41,7 +41,7 @@ from .color import OKLabColor, chalk, WebColor, RGBColor, LinearRGBColor, \
from .mat import Matrix
from .argparse import LetterSubparsers
__version__ = "0.14.0a1"
__version__ = "0.14.0a2"
__all__ = (
'ColorFormatter',
@ -50,7 +50,7 @@ __all__ = (
'LetterSubparsers', 'LinearRGBColor',
'Matrix', 'MissingConfigError', 'MissingConfigWarning', 'OKLabColor', 'OKLCHColor',
'PrefixIdentifier', 'RGBColor',
'Siq', 'SiqCache', 'SiqGen', 'SiqType', 'Snowflake', 'SnowflakeGen',
'Siq', 'SiqCache', 'SiqGen', 'SiqType', 'Snowflake', 'SnowflakeEpoch', 'SnowflakeGen',
'StringCase', 'TimedDict', 'TomlI18n', 'UserSigner', 'Wanted', 'WantsContentType',
'WebColor', 'XYZColor',
'addattr', 'additem', 'age_and_days', 'alru_cache', 'b2048decode', 'b2048encode',

View file

@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
from __future__ import annotations
from functools import wraps
from typing import Callable, Collection, TypeVar, Any
from typing import Callable, TypeVar
from . import deprecated

View file

@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
from __future__ import annotations
from binascii import unhexlify
import enum
import os
from threading import Lock
import time
@ -207,7 +208,15 @@ class Snowflake(int):
def __repr__(self):
return f'{self.__class__.__name__}({super().__repr__()})'
# Common epoch values.
class SnowflakeEpoch(int, enum.Enum):
"""Common epoch values."""
JAN_1_2025 = 1735686000
JAN_1_2020 = 1577833200
JAN_1_2015 = 1420066800
__all__ = (
'Snowflake', 'SnowflakeGen'
'Snowflake', 'SnowflakeGen', 'SnowflakeEpoch'
)