lingxingapi 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.

Potentially problematic release.


This version of lingxingapi might be problematic. Click here for more details.

Files changed (65) hide show
  1. lingxingapi/__init__.py +7 -0
  2. lingxingapi/ads/__init__.py +0 -0
  3. lingxingapi/ads/api.py +5946 -0
  4. lingxingapi/ads/param.py +192 -0
  5. lingxingapi/ads/route.py +134 -0
  6. lingxingapi/ads/schema.py +2615 -0
  7. lingxingapi/api.py +443 -0
  8. lingxingapi/base/__init__.py +0 -0
  9. lingxingapi/base/api.py +409 -0
  10. lingxingapi/base/param.py +59 -0
  11. lingxingapi/base/route.py +11 -0
  12. lingxingapi/base/schema.py +198 -0
  13. lingxingapi/basic/__init__.py +0 -0
  14. lingxingapi/basic/api.py +466 -0
  15. lingxingapi/basic/param.py +72 -0
  16. lingxingapi/basic/route.py +20 -0
  17. lingxingapi/basic/schema.py +212 -0
  18. lingxingapi/errors.py +143 -0
  19. lingxingapi/fba/__init__.py +0 -0
  20. lingxingapi/fba/api.py +1691 -0
  21. lingxingapi/fba/param.py +250 -0
  22. lingxingapi/fba/route.py +30 -0
  23. lingxingapi/fba/schema.py +987 -0
  24. lingxingapi/fields.py +50 -0
  25. lingxingapi/finance/__init__.py +0 -0
  26. lingxingapi/finance/api.py +3091 -0
  27. lingxingapi/finance/param.py +616 -0
  28. lingxingapi/finance/route.py +44 -0
  29. lingxingapi/finance/schema.py +1243 -0
  30. lingxingapi/product/__init__.py +0 -0
  31. lingxingapi/product/api.py +2643 -0
  32. lingxingapi/product/param.py +934 -0
  33. lingxingapi/product/route.py +49 -0
  34. lingxingapi/product/schema.py +1004 -0
  35. lingxingapi/purchase/__init__.py +0 -0
  36. lingxingapi/purchase/api.py +496 -0
  37. lingxingapi/purchase/param.py +126 -0
  38. lingxingapi/purchase/route.py +11 -0
  39. lingxingapi/purchase/schema.py +215 -0
  40. lingxingapi/sales/__init__.py +0 -0
  41. lingxingapi/sales/api.py +3200 -0
  42. lingxingapi/sales/param.py +723 -0
  43. lingxingapi/sales/route.py +70 -0
  44. lingxingapi/sales/schema.py +1718 -0
  45. lingxingapi/source/__init__.py +0 -0
  46. lingxingapi/source/api.py +1799 -0
  47. lingxingapi/source/param.py +176 -0
  48. lingxingapi/source/route.py +38 -0
  49. lingxingapi/source/schema.py +1011 -0
  50. lingxingapi/tools/__init__.py +0 -0
  51. lingxingapi/tools/api.py +291 -0
  52. lingxingapi/tools/param.py +73 -0
  53. lingxingapi/tools/route.py +8 -0
  54. lingxingapi/tools/schema.py +169 -0
  55. lingxingapi/utils.py +411 -0
  56. lingxingapi/warehourse/__init__.py +0 -0
  57. lingxingapi/warehourse/api.py +1778 -0
  58. lingxingapi/warehourse/param.py +506 -0
  59. lingxingapi/warehourse/route.py +28 -0
  60. lingxingapi/warehourse/schema.py +926 -0
  61. lingxingapi-1.0.0.dist-info/METADATA +67 -0
  62. lingxingapi-1.0.0.dist-info/RECORD +65 -0
  63. lingxingapi-1.0.0.dist-info/WHEEL +5 -0
  64. lingxingapi-1.0.0.dist-info/licenses/LICENSE +22 -0
  65. lingxingapi-1.0.0.dist-info/top_level.txt +1 -0
lingxingapi/fields.py ADDED
@@ -0,0 +1,50 @@
1
+ # -*- coding: utf-8 -*-
2
+ from typing import Annotated
3
+ from pydantic_core import CoreSchema, core_schema
4
+ from pydantic import GetCoreSchemaHandler, Field
5
+ from pydantic import NonNegativeInt, NonNegativeFloat
6
+
7
+
8
+ # Custom Field -----------------------------------------------------------------------------------------------------------------
9
+ NonEmptyStr = Annotated[str, Field(min_length=1)] # 非空字符串
10
+ CountryCode = Annotated[str, Field(min_length=2, max_length=2)] # 国家代码, 2位字符
11
+ CurrencyCode = Annotated[str, Field(min_length=3, max_length=3)] # 货币代码, 3位字符
12
+
13
+
14
+ class IntOrNone2Zero(int):
15
+ """自定义 int 数据类型解析
16
+
17
+ - 当传入 None 或空字符串时, 返回 0
18
+ - 其他情况按正常的 int 处理
19
+ """
20
+
21
+ def __get_pydantic_core_schema__(self, handler: GetCoreSchemaHandler) -> CoreSchema:
22
+ return core_schema.no_info_before_validator_function(
23
+ lambda v: 0 if v is None or v == "" else v, handler(int)
24
+ )
25
+
26
+
27
+ class FloatOrNone2Zero(float):
28
+ """自定义 float 数据类型解析
29
+
30
+ - 当传入 None 或空字符串时, 返回 0.0
31
+ - 其他情况按正常的 float 处理
32
+ """
33
+
34
+ def __get_pydantic_core_schema__(self, handler: GetCoreSchemaHandler) -> CoreSchema:
35
+ return core_schema.no_info_before_validator_function(
36
+ lambda v: 0.0 if v is None or v == "" else v, handler(float)
37
+ )
38
+
39
+
40
+ class StrOrNone2Blank(str):
41
+ """自定义 str 数据类型解析
42
+
43
+ - 当传入 None 时, 返回空字符串
44
+ - 其他情况按正常的 str 处理
45
+ """
46
+
47
+ def __get_pydantic_core_schema__(self, handler: GetCoreSchemaHandler) -> CoreSchema:
48
+ return core_schema.no_info_before_validator_function(
49
+ lambda v: "" if v is None else v, handler(str)
50
+ )
File without changes