tgshops-integrations 3.3__py3-none-any.whl → 3.5__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.
@@ -9,8 +9,8 @@ from models.products import ProductModel
9
9
  import sys
10
10
  sys.path.append('/home/latoff/Desktop/MarketBots')
11
11
 
12
- from tgshops_integrations.nocodb_connector.client import NocodbClient
13
- from tgshops_integrations.nocodb_connector.model_mapping import (
12
+ from nocodb_connector.client import NocodbClient
13
+ from nocodb_connector.model_mapping import (
14
14
  dump_product_data,
15
15
  dump_product_data_with_check,
16
16
  get_pagination_info,
@@ -23,8 +23,8 @@ from tgshops_integrations.nocodb_connector.model_mapping import (
23
23
  PRODUCT_IMAGES_LOOKUP_FIELD,
24
24
  PRODUCT_EXTERNAL_ID,
25
25
  )
26
- from tgshops_integrations.nocodb_connector.categories_management import CategoryManager
27
- from tgshops_integrations.nocodb_connector.products_management import ProductManager
26
+ from nocodb_connector.categories_management import CategoryManager
27
+ from nocodb_connector.products_management import ProductManager
28
28
  from loguru import logger
29
29
 
30
30
 
@@ -1,5 +1,5 @@
1
1
  from pydantic import BaseModel
2
- from typing import Any, List,Dict, Optional
2
+ from typing import Any, List,Dict,Optional
3
3
  from datetime import datetime
4
4
 
5
5
  from pydantic import BaseModel, Field, schema, validator
@@ -10,7 +10,6 @@ class ExtraAttribute(BaseModel):
10
10
 
11
11
  class ExternalProductModel(BaseModel):
12
12
  external_id: str
13
-
14
13
  category: Optional[List[str]]
15
14
  category_name: Optional[List[str]]
16
15
  name: str
@@ -3,8 +3,8 @@ from loguru import logger
3
3
  from aiocache import cached
4
4
  from models.categories import CategoryModel, CategoryResponseModel, CategoryListResponseModel
5
5
  from models.products import ProductModel
6
- from tgshops_integrations.nocodb_connector.client import custom_key_builder, NocodbClient
7
- from tgshops_integrations.nocodb_connector.model_mapping import (
6
+ from nocodb_connector.client import custom_key_builder, NocodbClient
7
+ from nocodb_connector.model_mapping import (
8
8
  CATEGORY_IMAGE_FIELD,
9
9
  CATEGORY_NAME_FIELD,
10
10
  CATEGORY_PARENT_FIELD,
@@ -3,8 +3,8 @@ import secrets
3
3
  import importlib.util
4
4
  from pathlib import Path
5
5
 
6
- from tgshops_integrations.models.categories import CategoryModel, CategoryResponseModel, PaginationResponseModel
7
- from tgshops_integrations.models.products import ExtraAttribute, ProductModel
6
+ from models.categories import CategoryModel, CategoryResponseModel, PaginationResponseModel
7
+ from models.products import ExtraAttribute, ProductModel
8
8
 
9
9
 
10
10
  # Helper function to load `config.py` dynamically
@@ -33,7 +33,7 @@ def initialize_model_mapping(config_path: str):
33
33
  global PRODUCT_IMAGE_FIELD, PRODUCT_DISCOUNT_PRICE_FIELD, PRODUCT_CATEGORY_ID_LOOKUP_FIELD, PRODUCT_IMAGES_LOOKUP_FIELD
34
34
  global PRODUCT_REQUIRED_OPTIONS_FIELD, PRODUCT_CATEGORIES_EXTRA_OPTIONS_FIELD, PRODUCT_CATEGORIES_EXTRA_OPTION_NAMES_FIELD
35
35
  global PRODUCT_EXTRA_CHOICE_REQUIRED_FIELD, PRODUCT_ID_FIELD, PRODUCT_EXTERNAL_ID, PRODUCT_CHECKOUT_MODE
36
- global NEW_ID_FIELD, NOCODB_CHECKOUT_MODES
36
+ global NEW_ID_FIELD, NOCODB_CHECKOUT_MODES,PRODUCT_CATEGORY_STRUCTURE
37
37
 
38
38
  config = load_config(config_path)
39
39
 
@@ -50,6 +50,7 @@ def initialize_model_mapping(config_path: str):
50
50
  PRODUCT_CURRENCY_FIELD = config.PRODUCT_CURRENCY_FIELD
51
51
  PRODUCT_STOCK_FIELD = config.PRODUCT_STOCK_FIELD
52
52
  PRODUCT_CATEGORY_NAME_FIELD = config.PRODUCT_CATEGORY_NAME_FIELD
53
+ PRODUCT_CATEGORY_STRUCTURE=config.PRODUCT_CATEGORY_STRUCTURE
53
54
  PRODUCT_CATEGORY_ID_FIELD = config.PRODUCT_CATEGORY_ID_FIELD
54
55
  PRODUCT_IMAGE_FIELD = config.PRODUCT_IMAGE_FIELD
55
56
  PRODUCT_DISCOUNT_PRICE_FIELD = config.PRODUCT_DISCOUNT_PRICE_FIELD
@@ -187,7 +188,8 @@ async def parse_product_data(data: dict) -> ProductModel:
187
188
  currency=data.get(PRODUCT_CURRENCY_FIELD, "RUB"),
188
189
  stock_qty=data.get(PRODUCT_STOCK_FIELD, 0),
189
190
  preview_url=preview_url,
190
- category_name=data.get(PRODUCT_CATEGORY_NAME_FIELD, []),
191
+ product_properties=data.get(PRODUCT_CATEGORY_NAME_FIELD, []),
192
+ categories_structure=data.get(PRODUCT_CATEGORY_STRUCTURE, {}),
191
193
  category=data.get(PRODUCT_CATEGORY_ID_LOOKUP_FIELD, []),
192
194
  extra_attributes=extra_attributes,
193
195
  extra_option_choice_required=bool(data.get(PRODUCT_EXTRA_CHOICE_REQUIRED_FIELD, [])),
@@ -3,8 +3,8 @@ import hashlib
3
3
  from aiocache import cached
4
4
  from loguru import logger
5
5
  from models.products import ProductModel
6
- from tgshops_integrations.nocodb_connector.client import custom_key_builder, NocodbClient
7
- from tgshops_integrations.nocodb_connector.model_mapping import (
6
+ from nocodb_connector.client import custom_key_builder, NocodbClient
7
+ from nocodb_connector.model_mapping import (
8
8
  dump_product_data,
9
9
  dump_product_data_with_check,
10
10
  get_pagination_info,
@@ -18,6 +18,7 @@ from tgshops_integrations.nocodb_connector.model_mapping import (
18
18
  PRODUCT_IMAGES_LOOKUP_FIELD,
19
19
  )
20
20
 
21
+
21
22
  class ProductManager(NocodbClient):
22
23
  def __init__(self, table_id=None, logging=False, NOCODB_HOST=None, NOCODB_API_KEY=None, SOURCE=None):
23
24
  super().__init__(NOCODB_HOST=NOCODB_HOST, NOCODB_API_KEY=NOCODB_API_KEY, SOURCE=SOURCE)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tgshops-integrations
3
- Version: 3.3
3
+ Version: 3.5
4
4
  Summary: Library is intended to provide the integration of the external service or CRM system with the TelegramShops/It allows to configure the relationship between NocoDB list of the products used further to display in the shop/As a resultss the products can be synchronized and updated uppon the request.
5
5
  Home-page: https://git.the-devs.com/virtual-shops/shop-system/shop-backend-integrations/integration-library/integration-library
6
6
  Author: Dimi Latoff
@@ -1,16 +1,16 @@
1
1
  tgshops_integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  tgshops_integrations/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- tgshops_integrations/middlewares/gateway.py,sha256=s6W2-O8BaAGlbNurl1_zbtbzCECN_E1n1Y3Cs57gLDg,6269
3
+ tgshops_integrations/middlewares/gateway.py,sha256=0ixrwo_Q-zx18sTGaT_MYqD9kVYPY499aOKn6k-Rc4o,6185
4
4
  tgshops_integrations/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  tgshops_integrations/models/categories.py,sha256=EG6C8g5dOfXB2MH-vtqH13aqB7_VyOobY2FHpDb-fsY,977
6
- tgshops_integrations/models/products.py,sha256=CpQ5LpeigklgVnkKPCm5jR9hfJsoFbWKSsDiTI32RSo,1405
6
+ tgshops_integrations/models/products.py,sha256=4XC6fyC91TAWj5oaX0A26kT_UizZIGaf4qyrVv9lPpQ,1403
7
7
  tgshops_integrations/nocodb_connector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- tgshops_integrations/nocodb_connector/categories_management.py,sha256=dvPXcrgruJyuWFT7Ho-8YRcjJxhR3Hcw0hJiVKQgcyA,6603
8
+ tgshops_integrations/nocodb_connector/categories_management.py,sha256=ZUvbby_mBkk4mtALgaiFtEuIaMVjv5T7TFwKTk9HCGo,6561
9
9
  tgshops_integrations/nocodb_connector/client.py,sha256=U2rNozjluWVul-VZroQW-8b2j6nEtKrhOkFMz1L8KmI,12022
10
- tgshops_integrations/nocodb_connector/model_mapping.py,sha256=ixv-uT1Pmt1szZCQ5pGsMbwRvmnHZmn0NqG77nxZkDM,8551
11
- tgshops_integrations/nocodb_connector/products_management.py,sha256=t_ZDyIAPTe_6UrxLuJ32Uhlk8ssErP6Eo0n-TIZfEko,6046
10
+ tgshops_integrations/nocodb_connector/model_mapping.py,sha256=X3zSmTP97rbQojMNppI0RRFDiex3bPyGDCRMk3_1Izs,8677
11
+ tgshops_integrations/nocodb_connector/products_management.py,sha256=KV1Ku8Va5Mq0CR4dkxUdYYZCqdIv49q29zVoQ4B770Q,6005
12
12
  tgshops_integrations/nocodb_connector/tables.py,sha256=ha_QXZXd93mht0fR5E1nM0wUpz1ePon-pIdO2HI67l8,356
13
- tgshops_integrations-3.3.dist-info/METADATA,sha256=m5yH6B1crk_IpJTDAy3ctmCz0X1udr7P1TGiyMC9Cx8,2774
14
- tgshops_integrations-3.3.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
15
- tgshops_integrations-3.3.dist-info/top_level.txt,sha256=HFNtxqDpzmlF4ZLnMiwhbU7pOa_YozxU2zBl0bnUmcY,21
16
- tgshops_integrations-3.3.dist-info/RECORD,,
13
+ tgshops_integrations-3.5.dist-info/METADATA,sha256=RI6nKF8PnJSdXBkyPoyt70tSDWlLNCM1K-X8kLJWqKI,2774
14
+ tgshops_integrations-3.5.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
15
+ tgshops_integrations-3.5.dist-info/top_level.txt,sha256=HFNtxqDpzmlF4ZLnMiwhbU7pOa_YozxU2zBl0bnUmcY,21
16
+ tgshops_integrations-3.5.dist-info/RECORD,,