solax-py-library 1.0.0.16__tar.gz → 1.0.0.18__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 (40) hide show
  1. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/PKG-INFO +1 -1
  2. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/pyproject.toml +1 -1
  3. solax_py_library-1.0.0.18/solax_py_library/__init__.py +1 -0
  4. solax_py_library-1.0.0.16/solax_py_library/upload/errors/base.py → solax_py_library-1.0.0.18/solax_py_library/exception.py +1 -1
  5. solax_py_library-1.0.0.18/solax_py_library/snap_shot/__init__.py +3 -0
  6. solax_py_library-1.0.0.18/solax_py_library/snap_shot/constant/__init__.py +5 -0
  7. solax_py_library-1.0.0.16/solax_py_library/snap_shot/address.py → solax_py_library-1.0.0.18/solax_py_library/snap_shot/constant/crc_table.py +0 -41
  8. solax_py_library-1.0.0.18/solax_py_library/snap_shot/core/__init__.py +7 -0
  9. solax_py_library-1.0.0.16/solax_py_library/snap_shot/core.py → solax_py_library-1.0.0.18/solax_py_library/snap_shot/core/snap_shot.py +3 -3
  10. solax_py_library-1.0.0.18/solax_py_library/snap_shot/exceptions/__init__.py +3 -0
  11. solax_py_library-1.0.0.18/solax_py_library/snap_shot/exceptions/snap_shot.py +9 -0
  12. solax_py_library-1.0.0.18/solax_py_library/snap_shot/types/__init__.py +15 -0
  13. solax_py_library-1.0.0.18/solax_py_library/snap_shot/types/address.py +39 -0
  14. solax_py_library-1.0.0.18/solax_py_library/upload/__init__.py +3 -0
  15. {solax_py_library-1.0.0.16/solax_py_library/upload/errors → solax_py_library-1.0.0.18/solax_py_library/upload/exceptions}/__init__.py +2 -2
  16. {solax_py_library-1.0.0.16/solax_py_library/upload/errors → solax_py_library-1.0.0.18/solax_py_library/upload/exceptions}/upload_error.py +5 -5
  17. solax_py_library-1.0.0.18/solax_py_library/upload/test/__init__.py +0 -0
  18. solax_py_library-1.0.0.18/solax_py_library/utils/__init__.py +0 -0
  19. solax_py_library-1.0.0.16/solax_py_library/snap_shot/untils.py → solax_py_library-1.0.0.18/solax_py_library/utils/common.py +0 -1
  20. {solax_py_library-1.0.0.16/solax_py_library/snap_shot → solax_py_library-1.0.0.18/solax_py_library/utils}/parser.py +2 -3
  21. solax_py_library-1.0.0.16/solax_py_library/__init__.py +0 -1
  22. solax_py_library-1.0.0.16/solax_py_library/snap_shot/__init__.py +0 -4
  23. solax_py_library-1.0.0.16/solax_py_library/snap_shot/exceptions.py +0 -6
  24. solax_py_library-1.0.0.16/solax_py_library/upload/__init__.py +0 -3
  25. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/README.md +0 -0
  26. {solax_py_library-1.0.0.16/solax_py_library/snap_shot → solax_py_library-1.0.0.18/solax_py_library/snap_shot/core}/base_modbus.py +0 -0
  27. {solax_py_library-1.0.0.16/solax_py_library/upload → solax_py_library-1.0.0.18/solax_py_library/snap_shot}/test/__init__.py +0 -0
  28. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/api/__init__.py +0 -0
  29. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/api/service.py +0 -0
  30. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/__init__.py +0 -0
  31. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/data_adapter/__init__.py +0 -0
  32. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/data_adapter/base.py +0 -0
  33. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/data_adapter/csv.py +0 -0
  34. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/upload_service/__init__.py +0 -0
  35. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/upload_service/base.py +0 -0
  36. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/core/upload_service/ftp.py +0 -0
  37. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/test/test_ftp.py +0 -0
  38. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/types/__init__.py +0 -0
  39. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/types/client.py +0 -0
  40. {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.18}/solax_py_library/upload/types/ftp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: solax-py-library
3
- Version: 1.0.0.16
3
+ Version: 1.0.0.18
4
4
  Summary: some common tool
5
5
  Author: shenlvyu
6
6
  Author-email: 13296718439@163.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "solax-py-library"
3
- version = "1.0.0.16"
3
+ version = "1.0.0.18"
4
4
  description = "some common tool"
5
5
  authors = ["shenlvyu <13296718439@163.com>", "x5m8944pjl <371630856@qq.com>"]
6
6
  readme = "README.md"
@@ -0,0 +1 @@
1
+ __all__ = ["upload", "snap_shot"]
@@ -1,4 +1,4 @@
1
- class UploadBaseError(Exception):
1
+ class SolaxBaseError(Exception):
2
2
  code = 0x1000
3
3
  message = "upload error"
4
4
 
@@ -0,0 +1,3 @@
1
+ from . import types, core, exceptions
2
+
3
+ __all__ = ["core", "exceptions", "types"]
@@ -0,0 +1,5 @@
1
+ from .crc_table import CRC_Table
2
+
3
+ __all__ = [
4
+ "CRC_Table",
5
+ ]
@@ -1,37 +1,3 @@
1
- from enum import Enum
2
-
3
-
4
- class SnapshotMCUSource(Enum):
5
- MCU_SOURCE_MDSP = 0
6
- MCU_SOURCE_SDSP = 1
7
-
8
-
9
- class SnapshotExportDevice(Enum):
10
- EXPORT_DEVICE_UART = 0
11
- EXPORT_DEVICE_USB = 1
12
-
13
-
14
- class SnapshotStartResult(Enum):
15
- SNAPSHOT_START_START = 0xAAAA
16
- SNAPSHOT_START_SUCCESS = 0xA5A5
17
- SNAPSHOT_START_FAILED = 0x5A5A
18
- SNAPSHOT_START_STOP = 0xBBBB
19
-
20
-
21
- class SnapshotRegisterAddress(Enum):
22
- SNAPSHOT_REGISTERADDRESS_MCUSOURCE = 0x4011
23
- SNAPSHOT_REGISTERADDRESS_EXPORTDEVICE = 0x4012
24
- SNAPSHOT_REGISTERADDRESS_START = 0x4013
25
- SNAPSHOT_REGISTERADDRESS_TOTALNUMBER = 0x4070
26
- SNAPSHOT_REGISTERADDRESS_SNAPSHOTINDEX = 0x4071
27
- SNAPSHOT_REGISTERADDRESS_PACKDATASTATUS = 0x4072
28
- SNAPSHOT_REGISTERADDRESS_DATASIZE = 0x4073
29
- SNAPSHOT_REGISTERADDRESS_CHANNELNUMBER = 0x4074
30
- SNAPSHOT_REGISTERADDRESS_CHANNELDATASIZE = 0x4075
31
- SNAPSHOT_REGISTERADDRESS_PACKINDEX = 0x407F
32
- SNAPSHOT_REGISTERADDRESS_PACKDATA = 0x4080
33
-
34
-
35
1
  CRC_Table = [
36
2
  0x0000,
37
3
  0x8005,
@@ -290,10 +256,3 @@ CRC_Table = [
290
256
  0x558207,
291
257
  0x550202,
292
258
  ]
293
-
294
-
295
- class CommandType(Enum):
296
- ACK = 0x80 # 接收应答
297
- TOTAL_PACKETS = 0x81 # 上报总包数
298
- DATA_PACKET = 0x82 # 具体分包数据
299
- ERROR = 0x83 # 报错应答
@@ -0,0 +1,7 @@
1
+ from .snap_shot import SnapshotCore
2
+ from .base_modbus import ModbusClientBase
3
+
4
+ __all__ = [
5
+ "SnapshotCore",
6
+ "ModbusClientBase",
7
+ ]
@@ -1,9 +1,9 @@
1
1
  from typing import Dict, Optional, List
2
2
  import asyncio
3
3
 
4
- from .base_modbus import ModbusClientBase
5
- from .address import *
6
- from .untils import retry
4
+ from solax_py_library.snap_shot.core.base_modbus import ModbusClientBase
5
+ from solax_py_library.snap_shot.types.address import *
6
+ from solax_py_library.utils.common import retry
7
7
 
8
8
 
9
9
  class SnapshotCore:
@@ -0,0 +1,3 @@
1
+ from .snap_shot import SnapshotError, SnapshotTimeoutError
2
+
3
+ __all__ = ["SnapshotError", "SnapshotTimeoutError"]
@@ -0,0 +1,9 @@
1
+ from solax_py_library.exception import SolaxBaseError
2
+
3
+
4
+ class SnapshotError(SolaxBaseError):
5
+ ...
6
+
7
+
8
+ class SnapshotTimeoutError(SnapshotError):
9
+ ...
@@ -0,0 +1,15 @@
1
+ from .address import (
2
+ SnapshotMCUSource,
3
+ SnapshotRegisterAddress,
4
+ SnapshotStartResult,
5
+ SnapshotExportDevice,
6
+ CommandType,
7
+ )
8
+
9
+ __all__ = [
10
+ "SnapshotMCUSource",
11
+ "SnapshotRegisterAddress",
12
+ "SnapshotStartResult",
13
+ "SnapshotExportDevice",
14
+ "CommandType",
15
+ ]
@@ -0,0 +1,39 @@
1
+ from enum import IntEnum
2
+
3
+
4
+ class SnapshotMCUSource(IntEnum):
5
+ MCU_SOURCE_MDSP = 0
6
+ MCU_SOURCE_SDSP = 1
7
+
8
+
9
+ class SnapshotExportDevice(IntEnum):
10
+ EXPORT_DEVICE_UART = 0
11
+ EXPORT_DEVICE_USB = 1
12
+
13
+
14
+ class SnapshotStartResult(IntEnum):
15
+ SNAPSHOT_START_START = 0xAAAA
16
+ SNAPSHOT_START_SUCCESS = 0xA5A5
17
+ SNAPSHOT_START_FAILED = 0x5A5A
18
+ SNAPSHOT_START_STOP = 0xBBBB
19
+
20
+
21
+ class SnapshotRegisterAddress(IntEnum):
22
+ SNAPSHOT_REGISTERADDRESS_MCUSOURCE = 0x4011
23
+ SNAPSHOT_REGISTERADDRESS_EXPORTDEVICE = 0x4012
24
+ SNAPSHOT_REGISTERADDRESS_START = 0x4013
25
+ SNAPSHOT_REGISTERADDRESS_TOTALNUMBER = 0x4070
26
+ SNAPSHOT_REGISTERADDRESS_SNAPSHOTINDEX = 0x4071
27
+ SNAPSHOT_REGISTERADDRESS_PACKDATASTATUS = 0x4072
28
+ SNAPSHOT_REGISTERADDRESS_DATASIZE = 0x4073
29
+ SNAPSHOT_REGISTERADDRESS_CHANNELNUMBER = 0x4074
30
+ SNAPSHOT_REGISTERADDRESS_CHANNELDATASIZE = 0x4075
31
+ SNAPSHOT_REGISTERADDRESS_PACKINDEX = 0x407F
32
+ SNAPSHOT_REGISTERADDRESS_PACKDATA = 0x4080
33
+
34
+
35
+ class CommandType(IntEnum):
36
+ ACK = 0x80 # 接收应答
37
+ TOTAL_PACKETS = 0x81 # 上报总包数
38
+ DATA_PACKET = 0x82 # 具体分包数据
39
+ ERROR = 0x83 # 报错应答
@@ -0,0 +1,3 @@
1
+ from . import api, types, core, exceptions
2
+
3
+ __all__ = ["api", "core", "exceptions", "types"]
@@ -1,8 +1,8 @@
1
- from .base import UploadBaseError
1
+ from solax_py_library.exception import SolaxBaseError
2
2
  from .upload_error import ConfigurationError, ConnectError, LoginError, SendDataError
3
3
 
4
4
  __all__ = [
5
- "UploadBaseError",
5
+ "SolaxBaseError",
6
6
  "ConnectError",
7
7
  "LoginError",
8
8
  "SendDataError",
@@ -1,21 +1,21 @@
1
- from .base import UploadBaseError
1
+ from solax_py_library.exception import SolaxBaseError
2
2
 
3
3
 
4
- class ConnectError(UploadBaseError):
4
+ class ConnectError(SolaxBaseError):
5
5
  code = 0x1001
6
6
  message = "connect error"
7
7
 
8
8
 
9
- class LoginError(UploadBaseError):
9
+ class LoginError(SolaxBaseError):
10
10
  code = 0x1002
11
11
  message = "authentication error"
12
12
 
13
13
 
14
- class SendDataError(UploadBaseError):
14
+ class SendDataError(SolaxBaseError):
15
15
  code = 0x1003
16
16
  message = "send data error"
17
17
 
18
18
 
19
- class ConfigurationError(UploadBaseError):
19
+ class ConfigurationError(SolaxBaseError):
20
20
  code = 0x1004
21
21
  message = "server configuration error"
@@ -1,4 +1,3 @@
1
- from .exceptions import SnapshotTimeoutError
2
1
  import asyncio
3
2
 
4
3
 
@@ -1,7 +1,8 @@
1
1
  import re
2
2
  import struct
3
3
 
4
- from .address import CRC_Table, CommandType
4
+ from solax_py_library.snap_shot.types.address import CommandType
5
+ from solax_py_library.snap_shot.constant.crc_table import CRC_Table
5
6
 
6
7
 
7
8
  class Parser:
@@ -72,8 +73,6 @@ class Parser:
72
73
  end = start + chunk_size
73
74
  yield (i, data[start:end])
74
75
 
75
- import struct
76
-
77
76
  def build_response_frame(
78
77
  self, task_id: str, business_type: int, ack_code: int
79
78
  ) -> bytes:
@@ -1 +0,0 @@
1
- __all__ = ["upload"]
@@ -1,4 +0,0 @@
1
- from .core import SnapshotCore
2
- from .parser import Parser
3
-
4
- __all__ = ["SnapshotCore", "Parser"]
@@ -1,6 +0,0 @@
1
- class SnapshotError(Exception):
2
- ...
3
-
4
-
5
- class SnapshotTimeoutError(SnapshotError):
6
- ...
@@ -1,3 +0,0 @@
1
- from . import api, types, core, errors
2
-
3
- __all__ = ["api", "core", "errors", "types"]