nomenclature-sdk 1.0.5__cp311-cp311-musllinux_1_2_x86_64.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.
@@ -0,0 +1,24 @@
1
+ from .client import NomenclatureClient
2
+ from .models import (
3
+ ConnectionOptions,
4
+ DBInfo,
5
+ NomenclatureKey,
6
+ NomenclatureItem,
7
+ NomenclatureFoundStatus,
8
+ FieldCompareResult,
9
+ NomenclatureCheckResult,
10
+ )
11
+ from .errors import ConnectionError, QueryError
12
+
13
+ __all__ = [
14
+ "NomenclatureClient",
15
+ "ConnectionOptions",
16
+ "DBInfo",
17
+ "NomenclatureKey",
18
+ "NomenclatureItem",
19
+ "NomenclatureFoundStatus",
20
+ "FieldCompareResult",
21
+ "NomenclatureCheckResult",
22
+ "ConnectionError",
23
+ "QueryError",
24
+ ]
@@ -0,0 +1,5 @@
1
+ from .client import NomenclatureClient as NomenclatureClient
2
+ from .errors import ConnectionError as ConnectionError, QueryError as QueryError
3
+ from .models import ConnectionOptions as ConnectionOptions, DBInfo as DBInfo, FieldCompareResult as FieldCompareResult, NomenclatureCheckResult as NomenclatureCheckResult, NomenclatureFoundStatus as NomenclatureFoundStatus, NomenclatureItem as NomenclatureItem, NomenclatureKey as NomenclatureKey
4
+
5
+ __all__ = ['NomenclatureClient', 'ConnectionOptions', 'DBInfo', 'NomenclatureKey', 'NomenclatureItem', 'NomenclatureFoundStatus', 'FieldCompareResult', 'NomenclatureCheckResult', 'ConnectionError', 'QueryError']
@@ -0,0 +1,6 @@
1
+ from .errors import QueryError as QueryError
2
+ from .models import DBInfo as DBInfo, FieldCompareResult as FieldCompareResult, NomenclatureCheckResult as NomenclatureCheckResult, NomenclatureFoundStatus as NomenclatureFoundStatus, NomenclatureItem as NomenclatureItem, NomenclatureKey as NomenclatureKey
3
+
4
+ def fetch_db_info(conn) -> DBInfo: ...
5
+ def get_field_compare_result(input_value: str, nomenclature_value: str) -> FieldCompareResult: ...
6
+ def check_nomenclature(conn, items: list[NomenclatureItem]) -> list[NomenclatureCheckResult]: ...
@@ -0,0 +1,8 @@
1
+ from ._internal import check_nomenclature as check_nomenclature, fetch_db_info as fetch_db_info
2
+ from .connection import open_connection as open_connection
3
+ from .models import ConnectionOptions as ConnectionOptions, DBInfo as DBInfo, NomenclatureCheckResult as NomenclatureCheckResult, NomenclatureItem as NomenclatureItem
4
+
5
+ class NomenclatureClient:
6
+ def __init__(self, options: ConnectionOptions) -> None: ...
7
+ def get_db_info(self) -> DBInfo: ...
8
+ def check_nomenclature(self, items: list[NomenclatureItem]) -> list[NomenclatureCheckResult]: ...
@@ -0,0 +1,4 @@
1
+ from .errors import ConnectionError as ConnectionError
2
+ from .models import ConnectionOptions as ConnectionOptions
3
+
4
+ def open_connection(opts: ConnectionOptions): ...
@@ -0,0 +1,9 @@
1
+ class SDKError(Exception):
2
+ """Базовая ошибка SDK"""
3
+
4
+ class ConnectionError(SDKError):
5
+ pass
6
+
7
+
8
+ class QueryError(SDKError):
9
+ pass
@@ -0,0 +1,3 @@
1
+ class SDKError(Exception): ...
2
+ class ConnectionError(SDKError): ...
3
+ class QueryError(SDKError): ...
@@ -0,0 +1,128 @@
1
+ from dataclasses import dataclass
2
+ from typing import List, Optional
3
+ from enum import Enum
4
+
5
+ @dataclass(frozen=True)
6
+ class ConnectionOptions:
7
+ """
8
+ Опции для подключения к базе данных
9
+
10
+ Attributes:
11
+ server: Имя или IP-адрес сервера БД.
12
+ database: Имя базы данных, к которой выполняется подключение.
13
+ user: Имя пользователя SQL Server.
14
+ password: Пароль пользователя.
15
+ encrypt: Использовать ли шифрование соединения (TLS).
16
+ port: TCP-порт SQL Server. По умолчанию: 1433.
17
+ trust_server_certificate: Доверять ли сертификату сервера без проверки цепочки.
18
+ timeout: Таймаут подключения в секундах.
19
+ """
20
+ server: str
21
+ database: str
22
+ user: str
23
+ password: str
24
+ encrypt: bool = True
25
+ port: int = 1433
26
+ trust_server_certificate: bool = False
27
+ timeout: int = 5
28
+
29
+ @dataclass(frozen=True)
30
+ class DBInfo:
31
+ """
32
+ Информация о базе данных
33
+
34
+ Attributes:
35
+ nomenclature_count_rows: Количество записей в номенклатурном справочнике.
36
+ manufacturer_synonym_count_rows: Количество синонимов для производителей.
37
+ user_fields: Пользовательские поля
38
+ """
39
+ nomenclature_count_rows: int
40
+ manufacturer_synonym_count_rows: int
41
+ user_fields: List[str]
42
+
43
+ @dataclass(frozen=True)
44
+ class NomenclatureKey:
45
+ """
46
+ Ключ номенклатуры.
47
+
48
+ Attributes:
49
+ manufacturer: Производитель товара.
50
+ identifier: Идентификатор товара.
51
+ """
52
+ manufacturer: str
53
+ identifier: str
54
+
55
+ @dataclass(frozen=True)
56
+ class NomenclatureItem:
57
+ """
58
+ Товар номенклатуры.
59
+
60
+ Attributes:
61
+ key: Ключ номенклатуры.
62
+ article: Артикул.
63
+ arths_codeicle: Код ТН ВЭД.
64
+ product_name: Наименвоание товара.
65
+ product_details: Характеристики товара.
66
+ product_model: Модель товара.
67
+ product_brand: Марка товара.
68
+ """
69
+ key: NomenclatureKey
70
+ article: Optional[str]
71
+ hs_code: Optional[str]
72
+ product_name: Optional[str]
73
+ product_details: Optional[str] = None
74
+ product_model: Optional[str] = None
75
+ product_brand: Optional[str] = None
76
+
77
+ class NomenclatureFoundStatus(Enum):
78
+ """
79
+ Статус найденности.
80
+
81
+ Attributes:
82
+ FOUND_BY_MANUFACTURER_AND_IDENTIFIER = 1: Товар найден по производителю и идентификатору.
83
+ FOUND_BY_MANUFACTURER_SYNONYM_AND_IDENTIFIER = 2: Товар найден по синониму производителя и идентификатору.
84
+ NOT_FOUND = 3: Товар не найден.
85
+ """
86
+ FOUND_BY_MANUFACTURER_AND_IDENTIFIER = 1
87
+ FOUND_BY_MANUFACTURER_SYNONYM_AND_IDENTIFIER = 2
88
+ NOT_FOUND = 3
89
+
90
+ @dataclass(frozen=True)
91
+ class FieldCompareResult:
92
+ """
93
+ Результат сравнения поля.
94
+
95
+ Attributes:
96
+ input_value: Входящие данные.
97
+ nomenclature_value: Данные из номенклатурного справочника.
98
+ is_equal: Данные идентичны.
99
+ """
100
+ input_value: str
101
+ nomenclature_value: str
102
+ is_equal: bool
103
+
104
+ @dataclass(frozen=True)
105
+ class NomenclatureCheckResult:
106
+ """
107
+ Результат сравнения товара.
108
+
109
+ Attributes:
110
+ key: люч номенклатуры.
111
+ article: Артикул.
112
+ arths_codeicle: Код ТН ВЭД.
113
+ product_name: Наименвоание товара.
114
+ product_details: Характеристики товара.
115
+ product_model: Модель товара.
116
+ product_brand: Марка товара.
117
+ found_status: Статус найденности.
118
+ is_equal: Данные идентичны.
119
+ """
120
+ key: NomenclatureKey
121
+ article: FieldCompareResult
122
+ hs_code: FieldCompareResult
123
+ product_name: FieldCompareResult
124
+ product_details: FieldCompareResult
125
+ product_model: FieldCompareResult
126
+ product_brand: FieldCompareResult
127
+ found_status: NomenclatureFoundStatus
128
+ is_equal: bool
@@ -0,0 +1,57 @@
1
+ from dataclasses import dataclass
2
+ from enum import Enum
3
+
4
+ @dataclass(frozen=True)
5
+ class ConnectionOptions:
6
+ server: str
7
+ database: str
8
+ user: str
9
+ password: str
10
+ encrypt: bool = ...
11
+ port: int = ...
12
+ trust_server_certificate: bool = ...
13
+ timeout: int = ...
14
+
15
+ @dataclass(frozen=True)
16
+ class DBInfo:
17
+ nomenclature_count_rows: int
18
+ manufacturer_synonym_count_rows: int
19
+ user_fields: list[str]
20
+
21
+ @dataclass(frozen=True)
22
+ class NomenclatureKey:
23
+ manufacturer: str
24
+ identifier: str
25
+
26
+ @dataclass(frozen=True)
27
+ class NomenclatureItem:
28
+ key: NomenclatureKey
29
+ article: str | None
30
+ hs_code: str | None
31
+ product_name: str | None
32
+ product_details: str | None = ...
33
+ product_model: str | None = ...
34
+ product_brand: str | None = ...
35
+
36
+ class NomenclatureFoundStatus(Enum):
37
+ FOUND_BY_MANUFACTURER_AND_IDENTIFIER = 1
38
+ FOUND_BY_MANUFACTURER_SYNONYM_AND_IDENTIFIER = 2
39
+ NOT_FOUND = 3
40
+
41
+ @dataclass(frozen=True)
42
+ class FieldCompareResult:
43
+ input_value: str
44
+ nomenclature_value: str
45
+ is_equal: bool
46
+
47
+ @dataclass(frozen=True)
48
+ class NomenclatureCheckResult:
49
+ key: NomenclatureKey
50
+ article: FieldCompareResult
51
+ hs_code: FieldCompareResult
52
+ product_name: FieldCompareResult
53
+ product_details: FieldCompareResult
54
+ product_model: FieldCompareResult
55
+ product_brand: FieldCompareResult
56
+ found_status: NomenclatureFoundStatus
57
+ is_equal: bool
File without changes
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.4
2
+ Name: nomenclature_sdk
3
+ Version: 1.0.5
4
+ Description-Content-Type: text/markdown
5
+ Requires-Dist: pyodbc
6
+ Dynamic: description
7
+ Dynamic: description-content-type
8
+ Dynamic: requires-dist
9
+
10
+ # SDK for nomenclature reference book
@@ -0,0 +1,18 @@
1
+ nomenclature_sdk/__init__.py,sha256=Bu4OpP2NX0qgbak_9aaAmYmLmmtgut7rvgkFgWWv034,526
2
+ nomenclature_sdk/__init__.pyi,sha256=3uIUMgRVAa8NhKSTyViaHYdlBTrBLhHsxzvm0EcgawM,652
3
+ nomenclature_sdk/_internal.cpython-311-x86_64-linux-musl.so,sha256=6wvH1a_wUJ8YhU4TYgIM9r0bqFSA_zalMAwkDCptNKU,491912
4
+ nomenclature_sdk/_internal.pyi,sha256=DMlWAZQAHv4oC4Nxn0TXWMzSX1BTS72ewK6qXbHn4SM,539
5
+ nomenclature_sdk/client.cpython-311-x86_64-linux-musl.so,sha256=VBFfzophIo7QNROj5dOTFyyEmXmHcxwe5-FKWe6DELA,285688
6
+ nomenclature_sdk/client.pyi,sha256=AMRuFP0sQSZMJlTPuBJlavHUNE-SfezjjTAcPSo-gSo,556
7
+ nomenclature_sdk/connection.cpython-311-x86_64-linux-musl.so,sha256=JmxjRUDt_gsZ5rWrOW64rQTOB39yoejBdQG-W5WENrk,286680
8
+ nomenclature_sdk/connection.pyi,sha256=e5bdhi0JNc5WvBN_PwVqcpgA1Ps4PlDZ7-6JTzxB8kA,165
9
+ nomenclature_sdk/errors.py,sha256=kH9GaerHr0tzWQhA5HQ7axOVdU9a-Uf9d5aGmbMgNs0,150
10
+ nomenclature_sdk/errors.pyi,sha256=CMiixLBEyXFL-TxoF4guGESeyfCBWEXm_4n5FtOAUng,100
11
+ nomenclature_sdk/models.py,sha256=KyUribTZSS9eFnWKFmEHz-2Gu_oQAzaSUAEagjG4k8k,4510
12
+ nomenclature_sdk/models.pyi,sha256=rZkKnZS8uQ-kQnOdhPG4QCgzrQsWhVSMeTsi7yG2Z2w,1403
13
+ nomenclature_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ nomenclature_sdk-1.0.5.dist-info/METADATA,sha256=jRVx-Aif85I0rj2WAQ6tvqHP2nfmx6eCCNxOcuSREFE,239
16
+ nomenclature_sdk-1.0.5.dist-info/WHEEL,sha256=kA_iIvT-cxTFNl4I8QDfFHN1DAyqZDYakVXCaObxeLo,112
17
+ nomenclature_sdk-1.0.5.dist-info/top_level.txt,sha256=uHbf-ALtRk-W-p4cK_15xxDvMUsTDfA53i-3VXJ2woU,23
18
+ nomenclature_sdk-1.0.5.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp311-cp311-musllinux_1_2_x86_64
5
+
@@ -0,0 +1,2 @@
1
+ nomenclature_sdk
2
+ tests
tests/__init__.py ADDED
File without changes