moy-nalog-api 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moy_nalog/__init__.py +88 -0
- moy_nalog/client.py +879 -0
- moy_nalog/enums.py +38 -0
- moy_nalog/exceptions.py +68 -0
- moy_nalog/models.py +180 -0
- moy_nalog_api-1.0.0.dist-info/METADATA +533 -0
- moy_nalog_api-1.0.0.dist-info/RECORD +9 -0
- moy_nalog_api-1.0.0.dist-info/WHEEL +4 -0
- moy_nalog_api-1.0.0.dist-info/licenses/LICENSE +21 -0
moy_nalog/__init__.py
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Moy Nalog API Client - The most complete Python client for Russian self-employed tax service.
|
|
3
|
+
|
|
4
|
+
Features:
|
|
5
|
+
- Async (httpx) and sync support
|
|
6
|
+
- Password and SMS authentication
|
|
7
|
+
- Automatic token refresh
|
|
8
|
+
- Session persistence
|
|
9
|
+
- Retry with exponential backoff
|
|
10
|
+
- Full Pydantic validation
|
|
11
|
+
- Multiple receipt items
|
|
12
|
+
- Income list with pagination
|
|
13
|
+
|
|
14
|
+
Example (async):
|
|
15
|
+
async with MoyNalogClient() as client:
|
|
16
|
+
await client.auth_by_password("1234567890", "password")
|
|
17
|
+
receipt = await client.create_receipt("Service", Decimal("1000"))
|
|
18
|
+
print(receipt.print_url)
|
|
19
|
+
|
|
20
|
+
Example (sync):
|
|
21
|
+
with MoyNalogClientSync() as client:
|
|
22
|
+
client.auth_by_password("1234567890", "password")
|
|
23
|
+
receipt = client.create_receipt("Service", Decimal("1000"))
|
|
24
|
+
print(receipt.print_url)
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from .client import MoyNalogClient, MoyNalogClientSync
|
|
28
|
+
from .enums import CancelReason, IncomeType, PaymentType
|
|
29
|
+
from .exceptions import (
|
|
30
|
+
AuthenticationError,
|
|
31
|
+
InvalidCredentialsError,
|
|
32
|
+
InvalidSMSCodeError,
|
|
33
|
+
MoyNalogError,
|
|
34
|
+
NetworkError,
|
|
35
|
+
RateLimitError,
|
|
36
|
+
ReceiptError,
|
|
37
|
+
SMSError,
|
|
38
|
+
SMSRateLimitError,
|
|
39
|
+
TokenExpiredError,
|
|
40
|
+
ValidationError,
|
|
41
|
+
)
|
|
42
|
+
from .models import (
|
|
43
|
+
AuthResult,
|
|
44
|
+
CancellationInfo,
|
|
45
|
+
Client,
|
|
46
|
+
IncomeList,
|
|
47
|
+
Receipt,
|
|
48
|
+
ServiceItem,
|
|
49
|
+
SessionData,
|
|
50
|
+
SMSChallenge,
|
|
51
|
+
UserProfile,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
__version__ = "1.0.0"
|
|
55
|
+
__author__ = "Kirill Nikulin"
|
|
56
|
+
__email__ = "me@kirodev.eu"
|
|
57
|
+
|
|
58
|
+
__all__ = [
|
|
59
|
+
# Clients
|
|
60
|
+
"MoyNalogClient",
|
|
61
|
+
"MoyNalogClientSync",
|
|
62
|
+
# Enums
|
|
63
|
+
"CancelReason",
|
|
64
|
+
"IncomeType",
|
|
65
|
+
"PaymentType",
|
|
66
|
+
# Models
|
|
67
|
+
"AuthResult",
|
|
68
|
+
"CancellationInfo",
|
|
69
|
+
"Client",
|
|
70
|
+
"IncomeList",
|
|
71
|
+
"Receipt",
|
|
72
|
+
"ServiceItem",
|
|
73
|
+
"SessionData",
|
|
74
|
+
"SMSChallenge",
|
|
75
|
+
"UserProfile",
|
|
76
|
+
# Exceptions
|
|
77
|
+
"MoyNalogError",
|
|
78
|
+
"AuthenticationError",
|
|
79
|
+
"InvalidCredentialsError",
|
|
80
|
+
"TokenExpiredError",
|
|
81
|
+
"SMSError",
|
|
82
|
+
"SMSRateLimitError",
|
|
83
|
+
"InvalidSMSCodeError",
|
|
84
|
+
"ReceiptError",
|
|
85
|
+
"ValidationError",
|
|
86
|
+
"NetworkError",
|
|
87
|
+
"RateLimitError",
|
|
88
|
+
]
|