You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a Node.js project, use `@influxdata/influxdb3-client`, which provides main (CommonJS),
181
+
module (ESM), and browser (UMD) exports.
182
+
Add the [InfluxDB 3 JavaScript client library](https://github.com/InfluxCommunity/influxdb3-js) using your preferred package manager--for example, using [`npm`](https://www.npmjs.com/):
183
+
184
+
```bash
185
+
npm install --save @influxdata/influxdb3-client
186
+
```
187
+
188
+
{{% /tab-content %}}
189
+
{{% tab-content %}}
190
+
<!-- BEGIN PYTHON INSTALL CLIENT LIBRARY -->
191
+
Install the [InfluxDB 3 Python client library](https://github.com/InfluxCommunity/influxdb3-python) using
192
+
[`pip`](https://pypi.org/project/pip/).
193
+
To use Pandas features, such as `to_pandas()`, provided by the Python
194
+
client library, you must also install the
195
+
[`pandas` package](https://pandas.pydata.org/).
196
+
197
+
```bash
198
+
pip install influxdb3-python pandas
199
+
```
178
200
179
201
{{% /tab-content %}}
180
202
{{< /tabs-wrapper >}}
181
203
182
-
#### Construct points and write line protocol
204
+
### Construct line protocol
205
+
206
+
With a [basic understanding of line protocol](/influxdb3/version/write-data/#line-protocol),
207
+
you can construct line protocol data and write it to {{% product-name %}}.
208
+
209
+
Use client library write methods to provide data as raw line protocol
210
+
or as `Point` objects that the client library converts to line protocol.
211
+
If your program creates the data you write to InfluxDB, the `Point`
212
+
interface to take advantage of type safety in your program.
183
213
184
214
Client libraries provide one or more `Point` constructor methods. Some libraries
185
215
support language-native data structures, such as Go's `struct`, for creating
186
216
points.
187
217
218
+
Examples in this guide show how to construct `Point` objects that follow the [example `home` schema](#example-home-schema),
219
+
and then write the points as line protocol data to an {{% product-name %}} database.
220
+
221
+
#### Example home schema
222
+
223
+
Consider a use case where you collect data from sensors in your home. Each
224
+
sensor collects temperature, humidity, and carbon monoxide readings.
225
+
226
+
To collect this data, use the following schema:
227
+
228
+
<!-- vale InfluxDataDocs.v3Schema = YES -->
229
+
230
+
-**table**: `home`
231
+
-**tags**
232
+
-`room`: Living Room or Kitchen
233
+
-**fields**
234
+
-`temp`: temperature in °C (float)
235
+
-`hum`: percent humidity (float)
236
+
-`co`: carbon monoxide in parts per million (integer)
237
+
-**timestamp**: Unix timestamp in _second_ precision
0 commit comments