foxglove-sdk 0.15.1__cp39-cp39-win_amd64.whl → 0.15.2__cp39-cp39-win_amd64.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 foxglove-sdk might be problematic. Click here for more details.

@@ -1,210 +1,210 @@
1
- from pathlib import Path
2
- from typing import Any, Callable
3
-
4
- from foxglove.websocket import AssetHandler
5
-
6
- from .cloud import CloudSink
7
- from .mcap import MCAPWriteOptions, MCAPWriter
8
- from .websocket import Capability, Service, WebSocketServer
9
-
10
- class BaseChannel:
11
- """
12
- A channel for logging messages.
13
- """
14
-
15
- def __init__(
16
- self,
17
- topic: str,
18
- message_encoding: str,
19
- schema: "Schema" | None = None,
20
- metadata: dict[str, str] | None = None,
21
- ) -> None: ...
22
- def id(self) -> int:
23
- """The unique ID of the channel"""
24
- ...
25
-
26
- def topic(self) -> str:
27
- """The topic name of the channel"""
28
- ...
29
-
30
- @property
31
- def message_encoding(self) -> str:
32
- """The message encoding for the channel"""
33
- ...
34
-
35
- def metadata(self) -> dict[str, str]:
36
- """
37
- Returns a copy of the channel's metadata.
38
-
39
- Note that changes made to the returned dictionary will not be applied to
40
- the channel's metadata.
41
- """
42
- ...
43
-
44
- def schema(self) -> "Schema" | None:
45
- """
46
- Returns a copy of the channel's schema.
47
-
48
- Note that changes made to the returned object will not be applied to
49
- the channel's schema.
50
- """
51
- ...
52
-
53
- def schema_name(self) -> str | None:
54
- """The name of the schema for the channel"""
55
- ...
56
-
57
- def has_sinks(self) -> bool:
58
- """Returns true if at least one sink is subscribed to this channel"""
59
- ...
60
-
61
- def log(
62
- self,
63
- msg: bytes,
64
- log_time: int | None = None,
65
- sink_id: int | None = None,
66
- ) -> None:
67
- """
68
- Log a message to the channel.
69
-
70
- :param msg: The message to log.
71
- :param log_time: The optional time the message was logged.
72
- :param sink_id: The sink ID to log the message to. If not provided, the message will be
73
- sent to all sinks.
74
- """
75
- ...
76
-
77
- def close(self) -> None: ...
78
-
79
- class Schema:
80
- """
81
- A schema for a message or service call.
82
- """
83
-
84
- name: str
85
- encoding: str
86
- data: bytes
87
-
88
- def __init__(
89
- self,
90
- *,
91
- name: str,
92
- encoding: str,
93
- data: bytes,
94
- ) -> None: ...
95
-
96
- class Context:
97
- """
98
- A context for logging messages.
99
-
100
- A context is the binding between channels and sinks. By default, the SDK will use a single
101
- global context for logging, but you can create multiple contexts in order to log to different
102
- topics to different sinks or servers. To do so, associate the context by passing it to the
103
- channel constructor and to :py:func:`open_mcap` or :py:func:`start_server`.
104
- """
105
-
106
- def __init__(self) -> None: ...
107
- def _create_channel(
108
- self,
109
- topic: str,
110
- message_encoding: str,
111
- schema: Schema | None = None,
112
- metadata: list[tuple[str, str]] | None = None,
113
- ) -> "BaseChannel":
114
- """
115
- Instead of calling this method, pass a context to a channel constructor.
116
- """
117
- ...
118
-
119
- @staticmethod
120
- def default() -> "Context":
121
- """
122
- Returns the default context.
123
- """
124
- ...
125
-
126
- class ChannelDescriptor:
127
- """
128
- Information about a channel
129
- """
130
-
131
- id: int
132
- topic: str
133
- message_encoding: str
134
- metadata: dict[str, str]
135
- schema: "Schema" | None
136
-
137
- SinkChannelFilter = Callable[[ChannelDescriptor], bool]
138
-
139
- def start_server(
140
- *,
141
- name: str | None = None,
142
- host: str | None = "127.0.0.1",
143
- port: int | None = 8765,
144
- capabilities: list[Capability] | None = None,
145
- server_listener: Any = None,
146
- supported_encodings: list[str] | None = None,
147
- services: list[Service] | None = None,
148
- asset_handler: AssetHandler | None = None,
149
- context: Context | None = None,
150
- session_id: str | None = None,
151
- channel_filter: SinkChannelFilter | None = None,
152
- ) -> WebSocketServer:
153
- """
154
- Start a websocket server for live visualization.
155
- """
156
- ...
157
-
158
- def start_cloud_sink(
159
- *,
160
- listener: Any = None,
161
- supported_encodings: list[str] | None = None,
162
- context: Context | None = None,
163
- session_id: str | None = None,
164
- ) -> CloudSink:
165
- """
166
- Connect to Foxglove Agent for remote visualization and teleop.
167
- """
168
- ...
169
-
170
- def enable_logging(level: int) -> None:
171
- """
172
- Forward SDK logs to python's logging facility.
173
- """
174
- ...
175
-
176
- def disable_logging() -> None:
177
- """
178
- Stop forwarding SDK logs.
179
- """
180
- ...
181
-
182
- def shutdown() -> None:
183
- """
184
- Shutdown the running websocket server.
185
- """
186
- ...
187
-
188
- def open_mcap(
189
- path: str | Path,
190
- *,
191
- allow_overwrite: bool = False,
192
- context: Context | None = None,
193
- channel_filter: SinkChannelFilter | None = None,
194
- writer_options: MCAPWriteOptions | None = None,
195
- ) -> MCAPWriter:
196
- """
197
- Creates a new MCAP file for recording.
198
-
199
- If a context is provided, the MCAP file will be associated with that context. Otherwise, the
200
- global context will be used.
201
-
202
- You must close the writer with close() or the with statement to ensure the file is correctly finished.
203
- """
204
- ...
205
-
206
- def get_channel_for_topic(topic: str) -> BaseChannel | None:
207
- """
208
- Get a previously-registered channel.
209
- """
210
- ...
1
+ from pathlib import Path
2
+ from typing import Any, Callable
3
+
4
+ from foxglove.websocket import AssetHandler
5
+
6
+ from .cloud import CloudSink
7
+ from .mcap import MCAPWriteOptions, MCAPWriter
8
+ from .websocket import Capability, Service, WebSocketServer
9
+
10
+ class BaseChannel:
11
+ """
12
+ A channel for logging messages.
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ topic: str,
18
+ message_encoding: str,
19
+ schema: "Schema" | None = None,
20
+ metadata: dict[str, str] | None = None,
21
+ ) -> None: ...
22
+ def id(self) -> int:
23
+ """The unique ID of the channel"""
24
+ ...
25
+
26
+ def topic(self) -> str:
27
+ """The topic name of the channel"""
28
+ ...
29
+
30
+ @property
31
+ def message_encoding(self) -> str:
32
+ """The message encoding for the channel"""
33
+ ...
34
+
35
+ def metadata(self) -> dict[str, str]:
36
+ """
37
+ Returns a copy of the channel's metadata.
38
+
39
+ Note that changes made to the returned dictionary will not be applied to
40
+ the channel's metadata.
41
+ """
42
+ ...
43
+
44
+ def schema(self) -> "Schema" | None:
45
+ """
46
+ Returns a copy of the channel's schema.
47
+
48
+ Note that changes made to the returned object will not be applied to
49
+ the channel's schema.
50
+ """
51
+ ...
52
+
53
+ def schema_name(self) -> str | None:
54
+ """The name of the schema for the channel"""
55
+ ...
56
+
57
+ def has_sinks(self) -> bool:
58
+ """Returns true if at least one sink is subscribed to this channel"""
59
+ ...
60
+
61
+ def log(
62
+ self,
63
+ msg: bytes,
64
+ log_time: int | None = None,
65
+ sink_id: int | None = None,
66
+ ) -> None:
67
+ """
68
+ Log a message to the channel.
69
+
70
+ :param msg: The message to log.
71
+ :param log_time: The optional time the message was logged.
72
+ :param sink_id: The sink ID to log the message to. If not provided, the message will be
73
+ sent to all sinks.
74
+ """
75
+ ...
76
+
77
+ def close(self) -> None: ...
78
+
79
+ class Schema:
80
+ """
81
+ A schema for a message or service call.
82
+ """
83
+
84
+ name: str
85
+ encoding: str
86
+ data: bytes
87
+
88
+ def __init__(
89
+ self,
90
+ *,
91
+ name: str,
92
+ encoding: str,
93
+ data: bytes,
94
+ ) -> None: ...
95
+
96
+ class Context:
97
+ """
98
+ A context for logging messages.
99
+
100
+ A context is the binding between channels and sinks. By default, the SDK will use a single
101
+ global context for logging, but you can create multiple contexts in order to log to different
102
+ topics to different sinks or servers. To do so, associate the context by passing it to the
103
+ channel constructor and to :py:func:`open_mcap` or :py:func:`start_server`.
104
+ """
105
+
106
+ def __init__(self) -> None: ...
107
+ def _create_channel(
108
+ self,
109
+ topic: str,
110
+ message_encoding: str,
111
+ schema: Schema | None = None,
112
+ metadata: list[tuple[str, str]] | None = None,
113
+ ) -> "BaseChannel":
114
+ """
115
+ Instead of calling this method, pass a context to a channel constructor.
116
+ """
117
+ ...
118
+
119
+ @staticmethod
120
+ def default() -> "Context":
121
+ """
122
+ Returns the default context.
123
+ """
124
+ ...
125
+
126
+ class ChannelDescriptor:
127
+ """
128
+ Information about a channel
129
+ """
130
+
131
+ id: int
132
+ topic: str
133
+ message_encoding: str
134
+ metadata: dict[str, str]
135
+ schema: "Schema" | None
136
+
137
+ SinkChannelFilter = Callable[[ChannelDescriptor], bool]
138
+
139
+ def start_server(
140
+ *,
141
+ name: str | None = None,
142
+ host: str | None = "127.0.0.1",
143
+ port: int | None = 8765,
144
+ capabilities: list[Capability] | None = None,
145
+ server_listener: Any = None,
146
+ supported_encodings: list[str] | None = None,
147
+ services: list[Service] | None = None,
148
+ asset_handler: AssetHandler | None = None,
149
+ context: Context | None = None,
150
+ session_id: str | None = None,
151
+ channel_filter: SinkChannelFilter | None = None,
152
+ ) -> WebSocketServer:
153
+ """
154
+ Start a websocket server for live visualization.
155
+ """
156
+ ...
157
+
158
+ def start_cloud_sink(
159
+ *,
160
+ listener: Any = None,
161
+ supported_encodings: list[str] | None = None,
162
+ context: Context | None = None,
163
+ session_id: str | None = None,
164
+ ) -> CloudSink:
165
+ """
166
+ Connect to Foxglove Agent for remote visualization and teleop.
167
+ """
168
+ ...
169
+
170
+ def enable_logging(level: int) -> None:
171
+ """
172
+ Forward SDK logs to python's logging facility.
173
+ """
174
+ ...
175
+
176
+ def disable_logging() -> None:
177
+ """
178
+ Stop forwarding SDK logs.
179
+ """
180
+ ...
181
+
182
+ def shutdown() -> None:
183
+ """
184
+ Shutdown the running websocket server.
185
+ """
186
+ ...
187
+
188
+ def open_mcap(
189
+ path: str | Path,
190
+ *,
191
+ allow_overwrite: bool = False,
192
+ context: Context | None = None,
193
+ channel_filter: SinkChannelFilter | None = None,
194
+ writer_options: MCAPWriteOptions | None = None,
195
+ ) -> MCAPWriter:
196
+ """
197
+ Creates a new MCAP file for recording.
198
+
199
+ If a context is provided, the MCAP file will be associated with that context. Otherwise, the
200
+ global context will be used.
201
+
202
+ You must close the writer with close() or the with statement to ensure the file is correctly finished.
203
+ """
204
+ ...
205
+
206
+ def get_channel_for_topic(topic: str) -> BaseChannel | None:
207
+ """
208
+ Get a previously-registered channel.
209
+ """
210
+ ...