clarity-api-sdk-python 0.2.12__tar.gz → 0.3.14__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 (56) hide show
  1. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/PKG-INFO +17 -1
  2. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/README.md +4 -0
  3. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/pyproject.toml +17 -1
  4. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/clarity_api_sdk_python.egg-info/PKG-INFO +17 -1
  5. clarity_api_sdk_python-0.3.14/src/clarity_api_sdk_python.egg-info/SOURCES.txt +52 -0
  6. clarity_api_sdk_python-0.3.14/src/clarity_api_sdk_python.egg-info/requires.txt +25 -0
  7. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/api/session.py +19 -5
  8. clarity_api_sdk_python-0.3.14/src/cti/main_api.py +19 -0
  9. clarity_api_sdk_python-0.3.14/src/cti/model/__init__.py +0 -0
  10. clarity_api_sdk_python-0.3.14/src/cti/model/altitude_source.py +66 -0
  11. clarity_api_sdk_python-0.3.14/src/cti/model/attitude_source.py +94 -0
  12. clarity_api_sdk_python-0.3.14/src/cti/model/depth_source.py +86 -0
  13. clarity_api_sdk_python-0.3.14/src/cti/model/device.py +92 -0
  14. clarity_api_sdk_python-0.3.14/src/cti/model/device_type.py +60 -0
  15. clarity_api_sdk_python-0.3.14/src/cti/model/final_product.py +66 -0
  16. clarity_api_sdk_python-0.3.14/src/cti/model/hierarchy.py +33 -0
  17. clarity_api_sdk_python-0.3.14/src/cti/model/layback_algorithm.py +47 -0
  18. clarity_api_sdk_python-0.3.14/src/cti/model/layback_source.py +68 -0
  19. clarity_api_sdk_python-0.3.14/src/cti/model/layback_type.py +47 -0
  20. clarity_api_sdk_python-0.3.14/src/cti/model/organization.py +42 -0
  21. clarity_api_sdk_python-0.3.14/src/cti/model/platform.py +55 -0
  22. clarity_api_sdk_python-0.3.14/src/cti/model/platform_type.py +53 -0
  23. clarity_api_sdk_python-0.3.14/src/cti/model/position_source.py +85 -0
  24. clarity_api_sdk_python-0.3.14/src/cti/model/processed_altitude.py +52 -0
  25. clarity_api_sdk_python-0.3.14/src/cti/model/processed_attitude.py +60 -0
  26. clarity_api_sdk_python-0.3.14/src/cti/model/processed_depth.py +66 -0
  27. clarity_api_sdk_python-0.3.14/src/cti/model/processed_layback.py +66 -0
  28. clarity_api_sdk_python-0.3.14/src/cti/model/processed_position.py +78 -0
  29. clarity_api_sdk_python-0.3.14/src/cti/model/processed_sidescan_ping.py +68 -0
  30. clarity_api_sdk_python-0.3.14/src/cti/model/processing_log.py +70 -0
  31. clarity_api_sdk_python-0.3.14/src/cti/model/project.py +52 -0
  32. clarity_api_sdk_python-0.3.14/src/cti/model/projection_option.py +42 -0
  33. clarity_api_sdk_python-0.3.14/src/cti/model/raw_altitude.py +66 -0
  34. clarity_api_sdk_python-0.3.14/src/cti/model/raw_attitude.py +78 -0
  35. clarity_api_sdk_python-0.3.14/src/cti/model/raw_depth.py +66 -0
  36. clarity_api_sdk_python-0.3.14/src/cti/model/raw_layback.py +66 -0
  37. clarity_api_sdk_python-0.3.14/src/cti/model/raw_position.py +114 -0
  38. clarity_api_sdk_python-0.3.14/src/cti/model/raw_sidescan_ping.py +67 -0
  39. clarity_api_sdk_python-0.3.14/src/cti/model/s3.py +51 -0
  40. clarity_api_sdk_python-0.3.14/src/cti/model/sidescan_ping_source.py +106 -0
  41. clarity_api_sdk_python-0.3.14/src/cti/model/source.py +88 -0
  42. clarity_api_sdk_python-0.3.14/src/cti/model/survey.py +70 -0
  43. clarity_api_sdk_python-0.3.14/src/cti/model/target.py +55 -0
  44. clarity_api_sdk_python-0.3.14/src/cti/model/tow_system.py +49 -0
  45. clarity_api_sdk_python-0.2.12/src/clarity_api_sdk_python.egg-info/SOURCES.txt +0 -15
  46. clarity_api_sdk_python-0.2.12/src/clarity_api_sdk_python.egg-info/requires.txt +0 -12
  47. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/setup.cfg +0 -0
  48. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/clarity_api_sdk_python.egg-info/dependency_links.txt +0 -0
  49. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/clarity_api_sdk_python.egg-info/top_level.txt +0 -0
  50. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/__init__.py +0 -0
  51. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/api/__init__.py +0 -0
  52. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/api/async_client.py +0 -0
  53. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/api/client.py +0 -0
  54. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/logger/__init__.py +0 -0
  55. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/logger/logger.py +0 -0
  56. {clarity_api_sdk_python-0.2.12 → clarity_api_sdk_python-0.3.14}/src/cti/main.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clarity-api-sdk-python
3
- Version: 0.2.12
3
+ Version: 0.3.14
4
4
  Summary: A Python SDK to connect to the CTI Clarity API server.
5
5
  Author-email: "Chesapeake Technology Inc." <support@chesapeaketech.com>
6
6
  Project-URL: Homepage, https://github.com/chesapeake-tech/clarity-api-sdk-python
@@ -14,7 +14,19 @@ Requires-Dist: brotli
14
14
  Requires-Dist: h2
15
15
  Requires-Dist: httpx_auth>=0.23.1
16
16
  Requires-Dist: httpx-retries>=0.4.5
17
+ Requires-Dist: pydantic==2.12.3
17
18
  Requires-Dist: structlog
19
+ Provides-Extra: dev
20
+ Requires-Dist: black==25.9.0; extra == "dev"
21
+ Requires-Dist: build==1.3.0; extra == "dev"
22
+ Requires-Dist: mypy==1.18.2; extra == "dev"
23
+ Requires-Dist: pre-commit==4.3.0; extra == "dev"
24
+ Requires-Dist: pylint==3.3.8; extra == "dev"
25
+ Requires-Dist: pytest==8.4.2; extra == "dev"
26
+ Requires-Dist: pytest-asyncio==1.3.0; extra == "dev"
27
+ Requires-Dist: pytest-md==0.2.0; extra == "dev"
28
+ Requires-Dist: pytest-mock==3.15.1; extra == "dev"
29
+ Requires-Dist: twine==6.2.0; extra == "dev"
18
30
  Provides-Extra: brotli
19
31
  Requires-Dist: httpx[brotli]>=0.28.1; extra == "brotli"
20
32
  Provides-Extra: http2
@@ -78,6 +90,10 @@ logger_b.info("This info message from logger_b should NOT be visible.")
78
90
  logger_b.warning("This is warning message from logger_b")
79
91
  ```
80
92
 
93
+ ## Model
94
+
95
+ Pydantic models.
96
+
81
97
  ## API
82
98
 
83
99
  ### Singleton async client
@@ -56,6 +56,10 @@ logger_b.info("This info message from logger_b should NOT be visible.")
56
56
  logger_b.warning("This is warning message from logger_b")
57
57
  ```
58
58
 
59
+ ## Model
60
+
61
+ Pydantic models.
62
+
59
63
  ## API
60
64
 
61
65
  ### Singleton async client
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "clarity-api-sdk-python"
8
- version = "0.2.12"
8
+ version = "0.3.14"
9
9
  authors = [
10
10
  { name="Chesapeake Technology Inc.", email="support@chesapeaketech.com" },
11
11
  ]
@@ -23,10 +23,23 @@ dependencies = [
23
23
  "h2",
24
24
  "httpx_auth>=0.23.1",
25
25
  "httpx-retries>=0.4.5",
26
+ "pydantic==2.12.3",
26
27
  "structlog",
27
28
  ]
28
29
 
29
30
  [project.optional-dependencies]
31
+ dev = [
32
+ "black==25.9.0",
33
+ "build==1.3.0",
34
+ "mypy==1.18.2",
35
+ "pre-commit==4.3.0",
36
+ "pylint==3.3.8",
37
+ "pytest==8.4.2",
38
+ "pytest-asyncio==1.3.0",
39
+ "pytest-md==0.2.0",
40
+ "pytest-mock==3.15.1",
41
+ "twine==6.2.0"
42
+ ]
30
43
  brotli = ["httpx[brotli]>=0.28.1"]
31
44
  http2 = ["httpx[http2]>=0.28.1"]
32
45
 
@@ -35,3 +48,6 @@ http2 = ["httpx[http2]>=0.28.1"]
35
48
 
36
49
  [tool.setuptools.packages.find]
37
50
  where = ["src"]
51
+
52
+ [tool.pylint.main]
53
+ max-line-length = 150
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clarity-api-sdk-python
3
- Version: 0.2.12
3
+ Version: 0.3.14
4
4
  Summary: A Python SDK to connect to the CTI Clarity API server.
5
5
  Author-email: "Chesapeake Technology Inc." <support@chesapeaketech.com>
6
6
  Project-URL: Homepage, https://github.com/chesapeake-tech/clarity-api-sdk-python
@@ -14,7 +14,19 @@ Requires-Dist: brotli
14
14
  Requires-Dist: h2
15
15
  Requires-Dist: httpx_auth>=0.23.1
16
16
  Requires-Dist: httpx-retries>=0.4.5
17
+ Requires-Dist: pydantic==2.12.3
17
18
  Requires-Dist: structlog
19
+ Provides-Extra: dev
20
+ Requires-Dist: black==25.9.0; extra == "dev"
21
+ Requires-Dist: build==1.3.0; extra == "dev"
22
+ Requires-Dist: mypy==1.18.2; extra == "dev"
23
+ Requires-Dist: pre-commit==4.3.0; extra == "dev"
24
+ Requires-Dist: pylint==3.3.8; extra == "dev"
25
+ Requires-Dist: pytest==8.4.2; extra == "dev"
26
+ Requires-Dist: pytest-asyncio==1.3.0; extra == "dev"
27
+ Requires-Dist: pytest-md==0.2.0; extra == "dev"
28
+ Requires-Dist: pytest-mock==3.15.1; extra == "dev"
29
+ Requires-Dist: twine==6.2.0; extra == "dev"
18
30
  Provides-Extra: brotli
19
31
  Requires-Dist: httpx[brotli]>=0.28.1; extra == "brotli"
20
32
  Provides-Extra: http2
@@ -78,6 +90,10 @@ logger_b.info("This info message from logger_b should NOT be visible.")
78
90
  logger_b.warning("This is warning message from logger_b")
79
91
  ```
80
92
 
93
+ ## Model
94
+
95
+ Pydantic models.
96
+
81
97
  ## API
82
98
 
83
99
  ### Singleton async client
@@ -0,0 +1,52 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/clarity_api_sdk_python.egg-info/PKG-INFO
4
+ src/clarity_api_sdk_python.egg-info/SOURCES.txt
5
+ src/clarity_api_sdk_python.egg-info/dependency_links.txt
6
+ src/clarity_api_sdk_python.egg-info/requires.txt
7
+ src/clarity_api_sdk_python.egg-info/top_level.txt
8
+ src/cti/__init__.py
9
+ src/cti/main.py
10
+ src/cti/main_api.py
11
+ src/cti/api/__init__.py
12
+ src/cti/api/async_client.py
13
+ src/cti/api/client.py
14
+ src/cti/api/session.py
15
+ src/cti/logger/__init__.py
16
+ src/cti/logger/logger.py
17
+ src/cti/model/__init__.py
18
+ src/cti/model/altitude_source.py
19
+ src/cti/model/attitude_source.py
20
+ src/cti/model/depth_source.py
21
+ src/cti/model/device.py
22
+ src/cti/model/device_type.py
23
+ src/cti/model/final_product.py
24
+ src/cti/model/hierarchy.py
25
+ src/cti/model/layback_algorithm.py
26
+ src/cti/model/layback_source.py
27
+ src/cti/model/layback_type.py
28
+ src/cti/model/organization.py
29
+ src/cti/model/platform.py
30
+ src/cti/model/platform_type.py
31
+ src/cti/model/position_source.py
32
+ src/cti/model/processed_altitude.py
33
+ src/cti/model/processed_attitude.py
34
+ src/cti/model/processed_depth.py
35
+ src/cti/model/processed_layback.py
36
+ src/cti/model/processed_position.py
37
+ src/cti/model/processed_sidescan_ping.py
38
+ src/cti/model/processing_log.py
39
+ src/cti/model/project.py
40
+ src/cti/model/projection_option.py
41
+ src/cti/model/raw_altitude.py
42
+ src/cti/model/raw_attitude.py
43
+ src/cti/model/raw_depth.py
44
+ src/cti/model/raw_layback.py
45
+ src/cti/model/raw_position.py
46
+ src/cti/model/raw_sidescan_ping.py
47
+ src/cti/model/s3.py
48
+ src/cti/model/sidescan_ping_source.py
49
+ src/cti/model/source.py
50
+ src/cti/model/survey.py
51
+ src/cti/model/target.py
52
+ src/cti/model/tow_system.py
@@ -0,0 +1,25 @@
1
+ httpx>=0.28.1
2
+ brotli
3
+ h2
4
+ httpx_auth>=0.23.1
5
+ httpx-retries>=0.4.5
6
+ pydantic==2.12.3
7
+ structlog
8
+
9
+ [brotli]
10
+ httpx[brotli]>=0.28.1
11
+
12
+ [dev]
13
+ black==25.9.0
14
+ build==1.3.0
15
+ mypy==1.18.2
16
+ pre-commit==4.3.0
17
+ pylint==3.3.8
18
+ pytest==8.4.2
19
+ pytest-asyncio==1.3.0
20
+ pytest-md==0.2.0
21
+ pytest-mock==3.15.1
22
+ twine==6.2.0
23
+
24
+ [http2]
25
+ httpx[http2]>=0.28.1
@@ -19,12 +19,11 @@ Example:
19
19
  asyncio.run(main())
20
20
 
21
21
  # In other modules
22
- from cti.api.session import async_client
22
+ from cti.api.session import get_async_client
23
23
 
24
24
  async def fetch_data():
25
- if async_client:
26
- response = await async_client.get(...)
27
- return response.json()
25
+ response = await get_async_client().get(...)
26
+ return response.json()
28
27
  """
29
28
 
30
29
  # pylint: disable=global-statement, unnecessary-dunder-call
@@ -32,7 +31,7 @@ Example:
32
31
  from cti.api.async_client import ClarityApiAsyncClient
33
32
 
34
33
  # The singleton instance, initially None.
35
- async_client: ClarityApiAsyncClient | None
34
+ async_client: ClarityApiAsyncClient | None = None
36
35
 
37
36
 
38
37
  async def initialize_async_client() -> None:
@@ -46,6 +45,21 @@ async def initialize_async_client() -> None:
46
45
  async_client = ClarityApiAsyncClient()
47
46
  await async_client.__aenter__()
48
47
 
48
+ def get_async_client() -> ClarityApiAsyncClient:
49
+ """Returns the shared ClarityApiAsyncClient instance.
50
+
51
+ If the client is not initialized, this function initializes it first.
52
+
53
+ Returns:
54
+ ClarityApiAsyncClient: The shared ClarityApiAsyncClient instance.
55
+
56
+ Raises:
57
+ ValueError: If initialize_async_client() has not been called first.
58
+ """
59
+ if async_client is None:
60
+ raise ValueError("initialize_async_client() must be called first to initialize client.")
61
+ return async_client
62
+
49
63
 
50
64
  async def close_async_client() -> None:
51
65
  """Closes the shared ClarityApiAsyncClient instance.
@@ -0,0 +1,19 @@
1
+ """Example"""
2
+
3
+ import asyncio
4
+
5
+ from cti.api.session import get_async_client, close_async_client, initialize_async_client
6
+
7
+ async def main():
8
+ """Example of using the Clarity API asynchronously
9
+ """
10
+ try:
11
+ await initialize_async_client()
12
+ client = get_async_client()
13
+ response = await client.get(url="/api/v1/status")
14
+ print(response.json())
15
+ finally:
16
+ await close_async_client()
17
+
18
+ if __name__ == "__main__":
19
+ asyncio.run(main())
@@ -0,0 +1,66 @@
1
+ """Pydantic models for altitude source data."""
2
+
3
+ from datetime import datetime
4
+ from uuid import UUID
5
+
6
+ from pydantic import BaseModel, ConfigDict
7
+
8
+
9
+ class AltitudeSourceBase(BaseModel):
10
+ """Base model for altitude source data.
11
+
12
+ Attributes:
13
+ input_timezone: Input timezone string.
14
+ start_time: Start timestamp.
15
+ end_time: End timestamp.
16
+ channels: Number of channels.
17
+ """
18
+
19
+ input_timezone: str
20
+ start_time: datetime
21
+ end_time: datetime
22
+ channels: int
23
+
24
+
25
+ class AltitudeSourceCreate(AltitudeSourceBase):
26
+ """Model for creating altitude source data.
27
+
28
+ Attributes:
29
+ device_id: Foreign key reference to Device.
30
+ source_id: Foreign key reference to Source.
31
+ """
32
+
33
+ device_id: UUID
34
+ source_id: UUID
35
+
36
+
37
+ class AltitudeSourceUpdate(BaseModel):
38
+ """Model for updating altitude source data.
39
+
40
+ Attributes:
41
+ input_timezone: Input timezone string.
42
+ start_time: Start timestamp.
43
+ end_time: End timestamp.
44
+ channels: Number of channels.
45
+ """
46
+
47
+ input_timezone: str | None = None
48
+ start_time: datetime | None = None
49
+ end_time: datetime | None = None
50
+ channels: int | None = None
51
+
52
+
53
+ class AltitudeSource(AltitudeSourceBase):
54
+ """Model for altitude source data with database fields.
55
+
56
+ Attributes:
57
+ altitude_source_id: Unique identifier for the altitude source.
58
+ device_id: Foreign key reference to Device.
59
+ source_id: Foreign key reference to Source.
60
+ """
61
+
62
+ altitude_source_id: UUID
63
+ device_id: UUID
64
+ source_id: UUID
65
+
66
+ model_config = ConfigDict(from_attributes=True)
@@ -0,0 +1,94 @@
1
+ """Pydantic models for attitude source data."""
2
+
3
+ from datetime import datetime
4
+ from uuid import UUID
5
+
6
+ from pydantic import BaseModel, ConfigDict
7
+
8
+
9
+ class AttitudeSourceBase(BaseModel):
10
+ """Base model for attitude source data.
11
+
12
+ Attributes:
13
+ input_timezone: Input timezone string.
14
+ channels: Number of channels.
15
+ start_time: Start timestamp.
16
+ end_time: End timestamp.
17
+ sample_rate: Sample rate in Hz.
18
+ projection_option: Foreign key reference to ProjectionOption.
19
+ apply_pitch: Whether to apply pitch correction.
20
+ offset_roll: Roll offset value.
21
+ offset_pitch: Pitch offset value.
22
+ offset_heading: Heading offset value.
23
+ offset_time: Time offset value.
24
+ """
25
+
26
+ input_timezone: str
27
+ channels: int
28
+ start_time: datetime
29
+ end_time: datetime
30
+ sample_rate: float | None = None
31
+ projection_option: UUID
32
+ apply_pitch: bool | None = None
33
+ offset_roll: float | None = None
34
+ offset_pitch: float | None = None
35
+ offset_heading: float | None = None
36
+ offset_time: float | None = None
37
+
38
+
39
+ class AttitudeSourceCreate(AttitudeSourceBase):
40
+ """Model for creating attitude source data.
41
+
42
+ Attributes:
43
+ device_id: Foreign key reference to Device.
44
+ source_id: Foreign key reference to Source.
45
+ """
46
+
47
+ device_id: UUID
48
+ source_id: UUID
49
+
50
+
51
+ class AttitudeSourceUpdate(BaseModel):
52
+ """Model for updating attitude source data.
53
+
54
+ Attributes:
55
+ input_timezone: Input timezone string.
56
+ channels: Number of channels.
57
+ start_time: Start timestamp.
58
+ end_time: End timestamp.
59
+ sample_rate: Sample rate in Hz.
60
+ projection_option: Foreign key reference to ProjectionOption.
61
+ apply_pitch: Whether to apply pitch correction.
62
+ offset_roll: Roll offset value.
63
+ offset_pitch: Pitch offset value.
64
+ offset_heading: Heading offset value.
65
+ offset_time: Time offset value.
66
+ """
67
+
68
+ input_timezone: str | None = None
69
+ channels: int | None = None
70
+ start_time: datetime | None = None
71
+ end_time: datetime | None = None
72
+ sample_rate: float | None = None
73
+ projection_option: UUID | None = None
74
+ apply_pitch: bool | None = None
75
+ offset_roll: float | None = None
76
+ offset_pitch: float | None = None
77
+ offset_heading: float | None = None
78
+ offset_time: float | None = None
79
+
80
+
81
+ class AttitudeSource(AttitudeSourceBase):
82
+ """Model for attitude source data with database fields.
83
+
84
+ Attributes:
85
+ attitude_source_id: Unique identifier for the attitude source.
86
+ device_id: Foreign key reference to Device.
87
+ source_id: Foreign key reference to Source.
88
+ """
89
+
90
+ attitude_source_id: UUID
91
+ device_id: UUID
92
+ source_id: UUID
93
+
94
+ model_config = ConfigDict(from_attributes=True)
@@ -0,0 +1,86 @@
1
+ """Pydantic models for depth source data."""
2
+
3
+ from datetime import datetime
4
+ from uuid import UUID
5
+
6
+ from pydantic import BaseModel, ConfigDict
7
+
8
+
9
+ class DepthSourceBase(BaseModel):
10
+ """Base model for depth source data.
11
+
12
+ Attributes:
13
+ input_timezone: Input timezone string.
14
+ channels: Number of channels.
15
+ start_time: Start timestamp.
16
+ end_time: End timestamp.
17
+ records: Number of records.
18
+ sample_rate: Sample rate in Hz.
19
+ smoothing: Smoothing parameter.
20
+ offset_z: Z-axis offset.
21
+ offset_time: Time offset.
22
+ """
23
+
24
+ input_timezone: str
25
+ channels: int
26
+ start_time: datetime
27
+ end_time: datetime
28
+ records: int | None = None
29
+ sample_rate: float | None = None
30
+ smoothing: float | None = None
31
+ offset_z: float | None = None
32
+ offset_time: float | None = None
33
+
34
+
35
+ class DepthSourceCreate(DepthSourceBase):
36
+ """Model for creating depth source data.
37
+
38
+ Attributes:
39
+ device_id: Foreign key reference to Device.
40
+ source_id: Foreign key reference to Source.
41
+ """
42
+
43
+ device_id: UUID
44
+ source_id: UUID
45
+
46
+
47
+ class DepthSourceUpdate(BaseModel):
48
+ """Model for updating depth source data.
49
+
50
+ Attributes:
51
+ input_timezone: Input timezone string.
52
+ channels: Number of channels.
53
+ start_time: Start timestamp.
54
+ end_time: End timestamp.
55
+ records: Number of records.
56
+ sample_rate: Sample rate in Hz.
57
+ smoothing: Smoothing parameter.
58
+ offset_z: Z-axis offset.
59
+ offset_time: Time offset.
60
+ """
61
+
62
+ input_timezone: str | None = None
63
+ channels: int | None = None
64
+ start_time: datetime | None = None
65
+ end_time: datetime | None = None
66
+ records: int | None = None
67
+ sample_rate: float | None = None
68
+ smoothing: float | None = None
69
+ offset_z: float | None = None
70
+ offset_time: float | None = None
71
+
72
+
73
+ class DepthSource(DepthSourceBase):
74
+ """Model for depth source data with database fields.
75
+
76
+ Attributes:
77
+ depth_source_id: Unique identifier for the depth source.
78
+ device_id: Foreign key reference to Device.
79
+ source_id: Foreign key reference to Source.
80
+ """
81
+
82
+ depth_source_id: UUID
83
+ device_id: UUID
84
+ source_id: UUID
85
+
86
+ model_config = ConfigDict(from_attributes=True)
@@ -0,0 +1,92 @@
1
+ """Pydantic models for device data."""
2
+
3
+ from datetime import datetime
4
+ from uuid import UUID
5
+
6
+ from pydantic import BaseModel, ConfigDict
7
+
8
+
9
+ class DeviceBase(BaseModel):
10
+ """Base model for device data.
11
+
12
+ Attributes:
13
+ name: Device name.
14
+ channels: Number of channels.
15
+ offset_x: X-axis offset.
16
+ offset_y: Y-axis offset.
17
+ offset_z: Z-axis offset.
18
+ offset_heading: Heading offset.
19
+ offset_pitch: Pitch offset.
20
+ offset_roll: Roll offset.
21
+ latency: Device latency.
22
+ is_towed: Whether the device is towed.
23
+ """
24
+
25
+ name: str
26
+ channels: int
27
+ offset_x: float
28
+ offset_y: float
29
+ offset_z: float
30
+ offset_heading: float
31
+ offset_pitch: float
32
+ offset_roll: float
33
+ latency: float
34
+ is_towed: bool
35
+
36
+
37
+ class DeviceCreate(DeviceBase):
38
+ """Model for creating device data.
39
+
40
+ Attributes:
41
+ platform_id: Foreign key reference to Platform.
42
+ device_type_id: Foreign key reference to DeviceType.
43
+ """
44
+
45
+ platform_id: UUID
46
+ device_type_id: UUID
47
+
48
+
49
+ class DeviceUpdate(DeviceBase):
50
+ """Model for updating device data.
51
+
52
+ Attributes:
53
+ name: Device name.
54
+ channels: Number of channels.
55
+ offset_x: X-axis offset.
56
+ offset_y: Y-axis offset.
57
+ offset_z: Z-axis offset.
58
+ offset_heading: Heading offset.
59
+ offset_pitch: Pitch offset.
60
+ offset_roll: Roll offset.
61
+ latency: Device latency.
62
+ is_towed: Whether the device is towed.
63
+ updated_by: User who updated the device.
64
+ """
65
+
66
+
67
+ class Device(DeviceBase):
68
+ """Model for device data with database fields.
69
+
70
+ Attributes:
71
+ device_id: Unique identifier for the device.
72
+ platform_id: Foreign key reference to Platform.
73
+ device_type_id: Foreign key reference to DeviceType.
74
+ updated_by: User who last updated the device.
75
+ updated_date: Date when the device was last updated.
76
+ created_date: Date when the device was created.
77
+ """
78
+
79
+ device_id: UUID
80
+ platform_id: UUID
81
+ device_type_id: UUID
82
+ updated_by: str
83
+ updated_date: datetime
84
+ created_date: datetime
85
+
86
+ model_config = ConfigDict(from_attributes=True)
87
+
88
+
89
+ class Devices(BaseModel):
90
+ """Model for a collection of devices."""
91
+
92
+ devices: list[Device]
@@ -0,0 +1,60 @@
1
+ """Pydantic models for device type data."""
2
+
3
+ from datetime import datetime
4
+ from uuid import UUID
5
+
6
+ from pydantic import BaseModel, ConfigDict
7
+
8
+
9
+ class DeviceTypeBase(BaseModel):
10
+ """Base model for device type data.
11
+
12
+ Attributes:
13
+ name: Device type name.
14
+ description: Device type description.
15
+ """
16
+
17
+ name: str
18
+ description: str | None = None
19
+
20
+
21
+ class DeviceTypeCreate(DeviceTypeBase):
22
+ """Model for creating device type data.
23
+
24
+ Attributes:
25
+ updated_by: User who created the device type.
26
+ """
27
+
28
+
29
+ class DeviceTypeUpdate(DeviceTypeBase):
30
+ """Model for updating device type data.
31
+
32
+ Attributes:
33
+ name: Device type name.
34
+ description: Device type description.
35
+ updated_by: User who updated the device type.
36
+ """
37
+
38
+
39
+ class DeviceType(DeviceTypeBase):
40
+ """Model for device type data with database fields.
41
+
42
+ Attributes:
43
+ device_type_id: Unique identifier for the device type.
44
+ updated_by: User who last updated the device type.
45
+ updated_date: Date when the device type was last updated.
46
+ created_date: Date when the device type was created.
47
+ """
48
+
49
+ device_type_id: UUID
50
+ updated_by: str
51
+ updated_date: datetime
52
+ created_date: datetime
53
+
54
+ model_config = ConfigDict(from_attributes=True)
55
+
56
+
57
+ class DeviceTypes(BaseModel):
58
+ """Model for a collection of device type."""
59
+
60
+ device_types: list[DeviceType]