summaryrefslogtreecommitdiff
path: root/src/otp2289/__init__.py
diff options
context:
space:
mode:
authorSimeon Simeonov2026-04-28 14:27:05 +0200
committerSimeon Simeonov2026-04-28 14:27:05 +0200
commit751c74e7de1c78a151fdd8b76f220d8411a2108a (patch)
tree0b13345aad6949a3325ca8f72b4eece14a0fe973 /src/otp2289/__init__.py
parent82ef6adec6e59f9cc9dc9fa1a13a2b43e534bada (diff)
Restructure the entire project, enforce linting and add support for type checkers
Diffstat (limited to 'src/otp2289/__init__.py')
-rw-r--r--src/otp2289/__init__.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/otp2289/__init__.py b/src/otp2289/__init__.py
index c9e3c74..8f8cf24 100644
--- a/src/otp2289/__init__.py
+++ b/src/otp2289/__init__.py
@@ -1,6 +1,6 @@
1# SPDX-License-Identifier: BSD-2-Clause-FreeBSD 1# SPDX-License-Identifier: BSD-2-Clause
2# 2#
3# Copyright (c) 2020-2025 Simeon Simeonov 3# Copyright (c) 2020-2026 Simeon Simeonov
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,7 @@ from .generator import (
30 OTPChallengeError, 30 OTPChallengeError,
31 OTPGenerator, 31 OTPGenerator,
32 OTPGeneratorError, 32 OTPGeneratorError,
33 OTPResponse,
33) 34)
34from .server import ( 35from .server import (
35 OTPInvalidResponseError, 36 OTPInvalidResponseError,
@@ -40,11 +41,11 @@ from .server import (
40) 41)
41 42
42__author__ = 'Simeon Simeonov' 43__author__ = 'Simeon Simeonov'
43__version__ = '1.2.2' 44__version__ = '2.0.0a'
44__license__ = 'BSD 2-Clause' 45__license__ = 'BSD 2-Clause'
45 46
46 47
47def int_or_str(value): 48def int_or_str(value: int | str) -> int | str:
48 """Returns int value of value when possible""" 49 """Returns int value of value when possible"""
49 try: 50 try:
50 return int(value) 51 return int(value)
@@ -61,6 +62,7 @@ __all__ = [
61 'OTPGenerator', 62 'OTPGenerator',
62 'OTPGeneratorError', 63 'OTPGeneratorError',
63 'OTPInvalidResponseError', 64 'OTPInvalidResponseError',
65 'OTPResponse',
64 'OTPState', 66 'OTPState',
65 'OTPStateError', 67 'OTPStateError',
66 'OTPStore', 68 'OTPStore',