tgshops-integrations 0.3__tar.gz → 0.5__tar.gz

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.
Files changed (23) hide show
  1. tgshops_integrations-0.5/PKG-INFO +81 -0
  2. tgshops_integrations-0.5/README.md +67 -0
  3. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/setup.py +1 -1
  4. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/models/products.py +0 -6
  5. tgshops_integrations-0.5/tgshops_integrations.egg-info/PKG-INFO +81 -0
  6. tgshops_integrations-0.3/PKG-INFO +0 -75
  7. tgshops_integrations-0.3/README.md +0 -61
  8. tgshops_integrations-0.3/tgshops_integrations.egg-info/PKG-INFO +0 -75
  9. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/setup.cfg +0 -0
  10. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/__init__.py +0 -0
  11. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/middlewares/__init__.py +0 -0
  12. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/middlewares/gateway.py +0 -0
  13. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/models/__init__.py +0 -0
  14. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/models/categories.py +0 -0
  15. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/nocodb_connector/__init__.py +0 -0
  16. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/nocodb_connector/categories.py +0 -0
  17. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/nocodb_connector/client.py +0 -0
  18. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/nocodb_connector/model_mapping.py +0 -0
  19. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/nocodb_connector/products.py +0 -0
  20. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations/nocodb_connector/tables.py +0 -0
  21. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations.egg-info/SOURCES.txt +0 -0
  22. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations.egg-info/dependency_links.txt +0 -0
  23. {tgshops_integrations-0.3 → tgshops_integrations-0.5}/tgshops_integrations.egg-info/top_level.txt +0 -0
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.1
2
+ Name: tgshops_integrations
3
+ Version: 0.5
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
+ from typing import List
23
+ import asyncio
24
+
25
+ from config import NocoDBConfig
26
+ from tgshops_integrations.middlewares.gateway import Gateway
27
+ from services.bitrix.client import BitrixClient
28
+
29
+ # Your credentials are here and source of the target table
30
+ NOCODB_HOST = NocoDBConfig.HOST
31
+ NOCODB_API_KEY = NocoDBConfig.API_KEY
32
+ SOURCE=NocoDBConfig.source_table
33
+
34
+ async def main():
35
+
36
+ # Here is your client to upload data from your service
37
+ bitrixService=BitrixClient()
38
+
39
+ # Products have to be in a according to the ProductModel
40
+ # class ProductModel(BaseModel):
41
+ # id: Optional[str]
42
+ # external_id: Optional[str]
43
+ # category: Optional[List[str]]
44
+ # category_name: Optional[List[str]]
45
+ # name: str
46
+ # description: Optional[str]
47
+ # price: Optional[float]
48
+ # final_price: Optional[float]
49
+ # currency: Optional[str]
50
+ # stock_qty: int
51
+ # orders_qty: int = Field(0, hidden_field=True)
52
+ # created: datetime = Field(default=datetime.now, hidden_field=True)
53
+ # updated: datetime = Field(default=datetime.now, hidden_field=True)
54
+ # preview_url: List[str] = []
55
+ # extra_attributes: List[ExtraAttribute] = []
56
+
57
+ bitrix_product_list=await bitrixService.get_crm_product_list()
58
+
59
+ NocoGateway = Gateway(NOCODB_HOST=NOCODB_HOST,NOCODB_API_KEY=NOCODB_API_KEY)
60
+
61
+ # Example how to clean your table
62
+ # await NocoGateway.load_data(SOURCE=SOURCE)
63
+ # await NocoGateway.delete_all_products()
64
+
65
+
66
+ # In order to obtain data from the table need to call load data, to obtain it for further comparation
67
+ await NocoGateway.load_data(SOURCE=SOURCE)
68
+ # Initializes any missing categories
69
+ await NocoGateway.category_manager.update_categories(external_products=bitrix_product_list)
70
+
71
+ # Creates or updates the products
72
+ await NocoGateway.update_products(external_products=bitrix_product_list)
73
+
74
+
75
+ asyncio.run(main())
76
+
77
+
78
+
79
+
80
+
81
+ ```
@@ -0,0 +1,67 @@
1
+
2
+
3
+
4
+
5
+
6
+ ```python
7
+
8
+ from typing import List
9
+ import asyncio
10
+
11
+ from config import NocoDBConfig
12
+ from tgshops_integrations.middlewares.gateway import Gateway
13
+ from services.bitrix.client import BitrixClient
14
+
15
+ # Your credentials are here and source of the target table
16
+ NOCODB_HOST = NocoDBConfig.HOST
17
+ NOCODB_API_KEY = NocoDBConfig.API_KEY
18
+ SOURCE=NocoDBConfig.source_table
19
+
20
+ async def main():
21
+
22
+ # Here is your client to upload data from your service
23
+ bitrixService=BitrixClient()
24
+
25
+ # Products have to be in a according to the ProductModel
26
+ # class ProductModel(BaseModel):
27
+ # id: Optional[str]
28
+ # external_id: Optional[str]
29
+ # category: Optional[List[str]]
30
+ # category_name: Optional[List[str]]
31
+ # name: str
32
+ # description: Optional[str]
33
+ # price: Optional[float]
34
+ # final_price: Optional[float]
35
+ # currency: Optional[str]
36
+ # stock_qty: int
37
+ # orders_qty: int = Field(0, hidden_field=True)
38
+ # created: datetime = Field(default=datetime.now, hidden_field=True)
39
+ # updated: datetime = Field(default=datetime.now, hidden_field=True)
40
+ # preview_url: List[str] = []
41
+ # extra_attributes: List[ExtraAttribute] = []
42
+
43
+ bitrix_product_list=await bitrixService.get_crm_product_list()
44
+
45
+ NocoGateway = Gateway(NOCODB_HOST=NOCODB_HOST,NOCODB_API_KEY=NOCODB_API_KEY)
46
+
47
+ # Example how to clean your table
48
+ # await NocoGateway.load_data(SOURCE=SOURCE)
49
+ # await NocoGateway.delete_all_products()
50
+
51
+
52
+ # In order to obtain data from the table need to call load data, to obtain it for further comparation
53
+ await NocoGateway.load_data(SOURCE=SOURCE)
54
+ # Initializes any missing categories
55
+ await NocoGateway.category_manager.update_categories(external_products=bitrix_product_list)
56
+
57
+ # Creates or updates the products
58
+ await NocoGateway.update_products(external_products=bitrix_product_list)
59
+
60
+
61
+ asyncio.run(main())
62
+
63
+
64
+
65
+
66
+
67
+ ```
@@ -2,7 +2,7 @@ from setuptools import setup,find_packages
2
2
 
3
3
  setup(
4
4
  name='tgshops_integrations',
5
- version='0.3',
5
+ version='0.5',
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  # List your library's dependencies here
@@ -29,7 +29,6 @@ class ExternalProductModel(BaseModel):
29
29
  class ProductModel(BaseModel):
30
30
  id: Optional[str]
31
31
  external_id: Optional[str]
32
-
33
32
  category: Optional[List[str]]
34
33
  category_name: Optional[List[str]]
35
34
  name: str
@@ -43,8 +42,3 @@ class ProductModel(BaseModel):
43
42
  updated: datetime = Field(default=datetime.now, hidden_field=True)
44
43
  preview_url: List[str] = []
45
44
  extra_attributes: List[ExtraAttribute] = []
46
-
47
-
48
-
49
- class ProductModel(ExternalProductModel):
50
- id: str
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.1
2
+ Name: tgshops-integrations
3
+ Version: 0.5
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
+ from typing import List
23
+ import asyncio
24
+
25
+ from config import NocoDBConfig
26
+ from tgshops_integrations.middlewares.gateway import Gateway
27
+ from services.bitrix.client import BitrixClient
28
+
29
+ # Your credentials are here and source of the target table
30
+ NOCODB_HOST = NocoDBConfig.HOST
31
+ NOCODB_API_KEY = NocoDBConfig.API_KEY
32
+ SOURCE=NocoDBConfig.source_table
33
+
34
+ async def main():
35
+
36
+ # Here is your client to upload data from your service
37
+ bitrixService=BitrixClient()
38
+
39
+ # Products have to be in a according to the ProductModel
40
+ # class ProductModel(BaseModel):
41
+ # id: Optional[str]
42
+ # external_id: Optional[str]
43
+ # category: Optional[List[str]]
44
+ # category_name: Optional[List[str]]
45
+ # name: str
46
+ # description: Optional[str]
47
+ # price: Optional[float]
48
+ # final_price: Optional[float]
49
+ # currency: Optional[str]
50
+ # stock_qty: int
51
+ # orders_qty: int = Field(0, hidden_field=True)
52
+ # created: datetime = Field(default=datetime.now, hidden_field=True)
53
+ # updated: datetime = Field(default=datetime.now, hidden_field=True)
54
+ # preview_url: List[str] = []
55
+ # extra_attributes: List[ExtraAttribute] = []
56
+
57
+ bitrix_product_list=await bitrixService.get_crm_product_list()
58
+
59
+ NocoGateway = Gateway(NOCODB_HOST=NOCODB_HOST,NOCODB_API_KEY=NOCODB_API_KEY)
60
+
61
+ # Example how to clean your table
62
+ # await NocoGateway.load_data(SOURCE=SOURCE)
63
+ # await NocoGateway.delete_all_products()
64
+
65
+
66
+ # In order to obtain data from the table need to call load data, to obtain it for further comparation
67
+ await NocoGateway.load_data(SOURCE=SOURCE)
68
+ # Initializes any missing categories
69
+ await NocoGateway.category_manager.update_categories(external_products=bitrix_product_list)
70
+
71
+ # Creates or updates the products
72
+ await NocoGateway.update_products(external_products=bitrix_product_list)
73
+
74
+
75
+ asyncio.run(main())
76
+
77
+
78
+
79
+
80
+
81
+ ```
@@ -1,75 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tgshops_integrations
3
- Version: 0.3
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
- ```
@@ -1,61 +0,0 @@
1
-
2
-
3
-
4
-
5
-
6
- ```python
7
-
8
- import tgshops_integrations
9
- import ExternalProductModel, ExternalCategoryModel from tgshops_integrations.models
10
-
11
- # Load external data
12
- external_categories = [ExternalCategoryModel(
13
- name="Drinks",
14
- image_url="https://example.com/image.jpg",
15
- external_id="0"
16
- ), CategoryModel(
17
- name="Coffee",
18
- image_url="https://example.com/image.jpg",
19
- external_id="1"
20
- )]
21
- external_products = [ExternalProductModel(
22
- name="Coffee",
23
- description="",
24
- price=10.0,
25
- currency="USD",
26
- image_url="https://example.com/image.jpg",
27
- category=List["0", "1"],
28
- external_id="0"
29
- )]
30
-
31
-
32
- # Initialise
33
- product_service = tgshops_integrations.ProductService(token="your_token_here")
34
-
35
- await product_service.update_categories(
36
- external_categories=external_categories
37
- )
38
-
39
- await product_service.update_products(
40
- external_products=external_products
41
- )
42
-
43
- # Here is the the custom integration of your service, which has to return products according to the ExternalProductModel
44
- bitrixService=BitrixClient()
45
- bitrix_product_list=await bitrixService.get_crm_product_list()
46
-
47
- # One gateway can work with several table / DBs
48
- NocoGateway = Gateway(NOCODB_HOST=NOCODB_HOST,NOCODB_API_KEY=NOCODB_API_KEY)
49
-
50
- # await NocoGateway.load_data()
51
- # await NocoGateway.delete_all_products()
52
-
53
- # Load data provides the access to the certain table and allows to obtain the data about the products or catergories
54
- await NocoGateway.load_data(SOURCE=SOURCE)
55
- await NocoGateway.category_manager.update_categories(external_products=bitrix_product_list)
56
- await NocoGateway.update_products(external_products=bitrix_product_list)
57
-
58
-
59
-
60
-
61
- ```
@@ -1,75 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tgshops-integrations
3
- Version: 0.3
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
- ```