tgshops-integrations 0.1__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.
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.1
2
+ Name: tgshops-integrations
3
+ Version: 0.1
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
+ Home-page: https://git.the-devs.com/virtual-shops/shop-system/shop-backend-integrations/integration-library/integration-library
6
+ Author: Dimi Latoff
7
+ Author-email: drpozd@gmail.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+
15
+
16
+
17
+
18
+
19
+
20
+ ```python
21
+
22
+ import tgshops_integrations
23
+ import ExternalProductModel, ExternalCategoryModel from tgshops_integrations.models
24
+
25
+ # Load external data
26
+ external_categories = [ExternalCategoryModel(
27
+ name="Drinks",
28
+ image_url="https://example.com/image.jpg",
29
+ external_id="0"
30
+ ), CategoryModel(
31
+ name="Coffee",
32
+ image_url="https://example.com/image.jpg",
33
+ external_id="1"
34
+ )]
35
+ external_products = [ExternalProductModel(
36
+ name="Coffee",
37
+ description="",
38
+ price=10.0,
39
+ currency="USD",
40
+ image_url="https://example.com/image.jpg",
41
+ category=List["0", "1"],
42
+ external_id="0"
43
+ )]
44
+
45
+
46
+ # Initialise
47
+ product_service = tgshops_integrations.ProductService(token="your_token_here")
48
+
49
+ await product_service.update_categories(
50
+ external_categories=external_categories
51
+ )
52
+
53
+ await product_service.update_products(
54
+ external_products=external_products
55
+ )
56
+
57
+ # Here is the the custom integration of your service, which has to return products according to the ExternalProductModel
58
+ bitrixService=BitrixClient()
59
+ bitrix_product_list=await bitrixService.get_crm_product_list()
60
+
61
+ # One gateway can work with several table / DBs
62
+ NocoGateway = Gateway(NOCODB_HOST=NOCODB_HOST,NOCODB_API_KEY=NOCODB_API_KEY)
63
+
64
+ # await NocoGateway.load_data()
65
+ # await NocoGateway.delete_all_products()
66
+
67
+ # Load data provides the access to the certain table and allows to obtain the data about the products or catergories
68
+ await NocoGateway.load_data(SOURCE=SOURCE)
69
+ await NocoGateway.category_manager.update_categories(external_products=bitrix_product_list)
70
+ await NocoGateway.update_products(external_products=bitrix_product_list)
71
+
72
+
73
+
74
+
75
+ ```
@@ -0,0 +1,4 @@
1
+ tgshops_integrations-0.1.dist-info/METADATA,sha256=tmTHSs-Fv4h1eCpzSWz9ciefn0kh5kKYGOgDBaMA2TU,2391
2
+ tgshops_integrations-0.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
3
+ tgshops_integrations-0.1.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ tgshops_integrations-0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.40.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+