{"cells":[{"block_group":"8758a76016b64ef3bbdf612eb8f71a15","cell_type":"markdown","execution_count":null,"metadata":{"deepnote_cell_height":271.125,"tags":[],"cell_id":"8758a76016b64ef3bbdf612eb8f71a15","deepnote_block_group":"8758a76016b64ef3bbdf612eb8f71a15","deepnote_cell_type":"markdown","deepnote_sorting_key":"0","deepnote_source":"![](./template-cover.jpg)"},"source":"![](./template-cover.jpg)"},{"block_group":"bc634738f7654bc0a95ed31d13aad0e4","cell_type":"markdown","execution_count":null,"metadata":{"deepnote_cell_height":215.59375,"tags":[],"cell_id":"bc634738f7654bc0a95ed31d13aad0e4","deepnote_block_group":"bc634738f7654bc0a95ed31d13aad0e4","deepnote_cell_type":"markdown","deepnote_sorting_key":"1","deepnote_source":"# Query InfluxDB from Deepnote\n\nThis template shows you how to fetch and visualize data from InfluxDB v2 in Deepnote. As an example, we're using [the simulated airSensors dataset built into InfluxDB](https://docs.influxdata.com/influxdb/v2.2/reference/sample-data/#air-sensor-sample-data). Click \"Run notebook\" at the top of this window to see it in action.\n\nThis template assumes you are familiar with the Flux language used to query InfluxDB.\n\n_Want to query your own data?_ Follow the next steps at the end of the notebook 👇"},"source":"# Query InfluxDB from Deepnote\n\nThis template shows you how to fetch and visualize data from InfluxDB v2 in Deepnote. As an example, we're using [the simulated airSensors dataset built into InfluxDB](https://docs.influxdata.com/influxdb/v2.2/reference/sample-data/#air-sensor-sample-data). Click \"Run notebook\" at the top of this window to see it in action.\n\nThis template assumes you are familiar with the Flux language used to query InfluxDB.\n\n_Want to query your own data?_ Follow the next steps at the end of the notebook 👇"},{"block_group":"f135d8ba5dc04e0885b2934c22f66524","cell_type":"code","execution_count":null,"metadata":{"execution_start":1656011532022,"execution_millis":97,"source_hash":"ba30f4a5","tags":[],"cell_id":"f135d8ba5dc04e0885b2934c22f66524","deepnote_to_be_reexecuted":false,"deepnote_block_group":"f135d8ba5dc04e0885b2934c22f66524","deepnote_cell_type":"code","deepnote_sorting_key":"2","deepnote_content_hash":"ba30f4a5","deepnote_execution_started_at":"2022-06-23T19:12:12.022Z","deepnote_execution_finished_at":"2022-06-23T19:12:12.119Z","deepnote_source":"import os\nfrom influxdb_client import InfluxDBClient"},"outputs":[],"source":"import os\nfrom influxdb_client import InfluxDBClient"},{"block_group":"9f068fba029c47ca8895d2dab54c5014","cell_type":"markdown","execution_count":null,"metadata":{"deepnote_cell_height":108.390625,"tags":[],"cell_id":"9f068fba029c47ca8895d2dab54c5014","deepnote_block_group":"9f068fba029c47ca8895d2dab54c5014","deepnote_cell_type":"markdown","deepnote_sorting_key":"3","deepnote_source":"## Query data from InfluxDB\n\nWe use our API key to compose a query in the Flux query language and run it against our InfluxDB instance."},"source":"## Query data from InfluxDB\n\nWe use our API key to compose a query in the Flux query language and run it against our InfluxDB instance."},{"block_group":"93f6c0dc5b654f778793ec28965f97db","cell_type":"code","execution_count":null,"metadata":{"execution_start":1656011532163,"execution_millis":1,"source_hash":"71c6278b","tags":[],"cell_id":"93f6c0dc5b654f778793ec28965f97db","deepnote_to_be_reexecuted":false,"deepnote_block_group":"93f6c0dc5b654f778793ec28965f97db","deepnote_cell_type":"code","deepnote_sorting_key":"4","deepnote_content_hash":"71c6278b","deepnote_execution_started_at":"2022-06-23T19:12:12.163Z","deepnote_execution_finished_at":"2022-06-23T19:12:12.164Z","deepnote_source":"# Change this to your token\n# You can use environment variables, too: https://docs.deepnote.com/environment/environment-variables\nINFLUXDB_TOKEN = \"wxKB63AOv5lUxOq_L5Yew2vEQS96a4f5bWGu7mQbRMMbYAXcyMxU5Q_SABKkhc6VI0Vm4P2y_xd5XgdMclHu_g==\"\n\n# Change this to the URL of your InfluxDB instance\nINFLUXDB_URL = \"https://us-central1-1.gcp.cloud2.influxdata.com\"\n\n# Change this to the name of your organization\nINFLUXDB_ORG = \"deepnote-examples\"\n\nclient = InfluxDBClient(\n url=INFLUXDB_URL, token=INFLUXDB_TOKEN, org=INFLUXDB_ORG\n)\n"},"outputs":[],"source":"# Change this to your token\n# You can use environment variables, too: https://docs.deepnote.com/environment/environment-variables\nINFLUXDB_TOKEN = \"wxKB63AOv5lUxOq_L5Yew2vEQS96a4f5bWGu7mQbRMMbYAXcyMxU5Q_SABKkhc6VI0Vm4P2y_xd5XgdMclHu_g==\"\n\n# Change this to the URL of your InfluxDB instance\nINFLUXDB_URL = \"https://us-central1-1.gcp.cloud2.influxdata.com\"\n\n# Change this to the name of your organization\nINFLUXDB_ORG = \"deepnote-examples\"\n\nclient = InfluxDBClient(\n url=INFLUXDB_URL, token=INFLUXDB_TOKEN, org=INFLUXDB_ORG\n)\n"},{"block_group":"d133c45f641d43c6ab71c9873077fbf6","cell_type":"markdown","execution_count":null,"metadata":{"deepnote_cell_height":74.796875,"tags":[],"cell_id":"d133c45f641d43c6ab71c9873077fbf6","deepnote_block_group":"d133c45f641d43c6ab71c9873077fbf6","deepnote_cell_type":"markdown","deepnote_sorting_key":"5","deepnote_source":"The Python client returns the result as a Pandas dataframe, which means we can leverage Deenote's built-in dataframe analysis. You can filter and sort each column to drill into the data."},"source":"The Python client returns the result as a Pandas dataframe, which means we can leverage Deenote's built-in dataframe analysis. You can filter and sort each column to drill into the data."},{"block_group":"172de5071ad64136a53c2547e2cecfe3","cell_type":"code","execution_count":null,"metadata":{"execution_start":1656011532164,"execution_millis":1476,"source_hash":"f1c8972e","deepnote_table_state":{"sortBy":[],"filters":[],"pageSize":10,"pageIndex":4},"tags":[],"cell_id":"172de5071ad64136a53c2547e2cecfe3","deepnote_table_loading":false,"deepnote_to_be_reexecuted":false,"deepnote_block_group":"172de5071ad64136a53c2547e2cecfe3","deepnote_cell_type":"code","deepnote_sorting_key":"6","deepnote_content_hash":"f1c8972e","deepnote_execution_started_at":"2022-06-23T19:12:12.164Z","deepnote_execution_finished_at":"2022-06-23T19:12:13.640Z","deepnote_source":"query_api = client.query_api()\n\nquery = \"\"\"import \"influxdata/influxdb/sample\"\n\nsample.data(set: \"airSensor\")\n |> filter(fn: (r) => r._field == \"temperature\")\n |> range(start: -45m)\n |> aggregateWindow(every: 1m, fn: mean)\"\"\"\n\n# influxdb_client gives us Pandas dataframes out-of-the-box\ndf = query_api.query_data_frame(query)\n\ndf\n"},"outputs":[{"output_type":"execute_result","execution_count":3,"data":{"application/vnd.deepnote.dataframe.v3+json":{"column_count":9,"row_count":368,"columns":[{"name":"result","dtype":"object","stats":{"unique_count":1,"nan_count":0,"categories":[{"name":"_result","count":368}]}},{"name":"table","dtype":"int64","stats":{"unique_count":8,"nan_count":0,"min":"0","max":"7","histogram":[{"bin_start":0,"bin_end":0.7,"count":46},{"bin_start":0.7,"bin_end":1.4,"count":46},{"bin_start":1.4,"bin_end":2.0999999999999996,"count":46},{"bin_start":2.0999999999999996,"bin_end":2.8,"count":0},{"bin_start":2.8,"bin_end":3.5,"count":46},{"bin_start":3.5,"bin_end":4.199999999999999,"count":46},{"bin_start":4.199999999999999,"bin_end":4.8999999999999995,"count":0},{"bin_start":4.8999999999999995,"bin_end":5.6,"count":46},{"bin_start":5.6,"bin_end":6.3,"count":46},{"bin_start":6.3,"bin_end":7,"count":46}]}},{"name":"_time","dtype":"datetime64[ns, tzlocal()]","stats":{"unique_count":46,"nan_count":0,"min":"2022-06-23 18:28:00+00:00","max":"2022-06-23 19:12:12.245438+00:00","histogram":[{"bin_start":1656008880000000000,"bin_end":1656009145224543700,"count":40},{"bin_start":1656009145224543700,"bin_end":1656009410449087500,"count":32},{"bin_start":1656009410449087500,"bin_end":1656009675673631500,"count":40},{"bin_start":1656009675673631500,"bin_end":1656009940898175200,"count":32},{"bin_start":1656009940898175200,"bin_end":1656010206122719000,"count":40},{"bin_start":1656010206122719000,"bin_end":1656010471347262700,"count":32},{"bin_start":1656010471347262700,"bin_end":1656010736571806500,"count":32},{"bin_start":1656010736571806500,"bin_end":1656011001796350500,"count":40},{"bin_start":1656011001796350500,"bin_end":1656011267020894200,"count":32},{"bin_start":1656011267020894200,"bin_end":1656011532245438000,"count":48}]}},{"name":"_start","dtype":"datetime64[ns, tzlocal()]","stats":{"unique_count":1,"nan_count":0,"min":"2022-06-23 18:27:12.245438+00:00","max":"2022-06-23 18:27:12.245438+00:00","histogram":null}},{"name":"_stop","dtype":"datetime64[ns, tzlocal()]","stats":{"unique_count":1,"nan_count":0,"min":"2022-06-23 19:12:12.245438+00:00","max":"2022-06-23 19:12:12.245438+00:00","histogram":null}},{"name":"_field","dtype":"object","stats":{"unique_count":1,"nan_count":0,"categories":[{"name":"temperature","count":368}]}},{"name":"_measurement","dtype":"object","stats":{"unique_count":1,"nan_count":0,"categories":[{"name":"airSensors","count":368}]}},{"name":"sensor_id","dtype":"object","stats":{"unique_count":8,"nan_count":0,"categories":[{"name":"TLM0100","count":46},{"name":"TLM0101","count":46},{"name":"6 others","count":276}]}},{"name":"_value","dtype":"float64","stats":{"unique_count":312,"nan_count":56,"min":"70.66973156692363","max":"75.62100941370004","histogram":[{"bin_start":70.66973156692363,"bin_end":71.16485935160127,"count":59},{"bin_start":71.16485935160127,"bin_end":71.65998713627891,"count":38},{"bin_start":71.65998713627891,"bin_end":72.15511492095655,"count":30},{"bin_start":72.15511492095655,"bin_end":72.6502427056342,"count":25},{"bin_start":72.6502427056342,"bin_end":73.14537049031183,"count":21},{"bin_start":73.14537049031183,"bin_end":73.64049827498947,"count":22},{"bin_start":73.64049827498947,"bin_end":74.13562605966712,"count":5},{"bin_start":74.13562605966712,"bin_end":74.63075384434475,"count":29},{"bin_start":74.63075384434475,"bin_end":75.1258816290224,"count":36},{"bin_start":75.1258816290224,"bin_end":75.62100941370004,"count":47}]}},{"name":"_deepnote_index_column","dtype":"int64"}],"rows":[{"result":"_result","table":0,"_time":"2022-06-23T19:08:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0100","_value":"nan","_deepnote_index_column":40},{"result":"_result","table":0,"_time":"2022-06-23T19:09:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0100","_value":"nan","_deepnote_index_column":41},{"result":"_result","table":0,"_time":"2022-06-23T19:10:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0100","_value":"nan","_deepnote_index_column":42},{"result":"_result","table":0,"_time":"2022-06-23T19:11:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0100","_value":"nan","_deepnote_index_column":43},{"result":"_result","table":0,"_time":"2022-06-23T19:12:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0100","_value":"nan","_deepnote_index_column":44},{"result":"_result","table":0,"_time":"2022-06-23T19:12:12.245438","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0100","_value":"nan","_deepnote_index_column":45},{"result":"_result","table":1,"_time":"2022-06-23T18:28:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0101","_value":71.56077485961086,"_deepnote_index_column":46},{"result":"_result","table":1,"_time":"2022-06-23T18:29:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0101","_value":71.6057852910876,"_deepnote_index_column":47},{"result":"_result","table":1,"_time":"2022-06-23T18:30:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0101","_value":71.60346207425799,"_deepnote_index_column":48},{"result":"_result","table":1,"_time":"2022-06-23T18:31:00.000000","_start":"2022-06-23T18:27:12.245438","_stop":"2022-06-23T19:12:12.245438","_field":"temperature","_measurement":"airSensors","sensor_id":"TLM0101","_value":71.62870434562065,"_deepnote_index_column":49}]},"text/plain":" result table _time \\\n0 _result 0 2022-06-23 18:28:00+00:00 \n1 _result 0 2022-06-23 18:29:00+00:00 \n2 _result 0 2022-06-23 18:30:00+00:00 \n3 _result 0 2022-06-23 18:31:00+00:00 \n4 _result 0 2022-06-23 18:32:00+00:00 \n.. ... ... ... \n363 _result 7 2022-06-23 19:09:00+00:00 \n364 _result 7 2022-06-23 19:10:00+00:00 \n365 _result 7 2022-06-23 19:11:00+00:00 \n366 _result 7 2022-06-23 19:12:00+00:00 \n367 _result 7 2022-06-23 19:12:12.245438+00:00 \n\n _start _stop \\\n0 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n1 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n2 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n3 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n4 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n.. ... ... \n363 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n364 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n365 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n366 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n367 2022-06-23 18:27:12.245438+00:00 2022-06-23 19:12:12.245438+00:00 \n\n _field _measurement sensor_id _value \n0 temperature airSensors TLM0100 71.101404 \n1 temperature airSensors TLM0100 71.151548 \n2 temperature airSensors TLM0100 71.194573 \n3 temperature airSensors TLM0100 71.242369 \n4 temperature airSensors TLM0100 71.178880 \n.. ... ... ... ... \n363 temperature airSensors TLM0203 NaN \n364 temperature airSensors TLM0203 NaN \n365 temperature airSensors TLM0203 NaN \n366 temperature airSensors TLM0203 NaN \n367 temperature airSensors TLM0203 NaN \n\n[368 rows x 9 columns]","text/html":"
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
resulttable_time_start_stop_field_measurementsensor_id_value
0_result02022-06-23 18:28:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM010071.101404
1_result02022-06-23 18:29:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM010071.151548
2_result02022-06-23 18:30:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM010071.194573
3_result02022-06-23 18:31:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM010071.242369
4_result02022-06-23 18:32:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM010071.178880
..............................
363_result72022-06-23 19:09:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM0203NaN
364_result72022-06-23 19:10:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM0203NaN
365_result72022-06-23 19:11:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM0203NaN
366_result72022-06-23 19:12:00+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM0203NaN
367_result72022-06-23 19:12:12.245438+00:002022-06-23 18:27:12.245438+00:002022-06-23 19:12:12.245438+00:00temperatureairSensorsTLM0203NaN
\n

368 rows × 9 columns

\n
"},"metadata":{}}],"source":"query_api = client.query_api()\n\nquery = \"\"\"import \"influxdata/influxdb/sample\"\n\nsample.data(set: \"airSensor\")\n |> filter(fn: (r) => r._field == \"temperature\")\n |> range(start: -45m)\n |> aggregateWindow(every: 1m, fn: mean)\"\"\"\n\n# influxdb_client gives us Pandas dataframes out-of-the-box\ndf = query_api.query_data_frame(query)\n\ndf\n"},{"block_group":"a9649b90b8864d4d833e8798f64b4b6c","cell_type":"markdown","execution_count":null,"metadata":{"deepnote_cell_height":144.796875,"tags":[],"cell_id":"a9649b90b8864d4d833e8798f64b4b6c","deepnote_block_group":"a9649b90b8864d4d833e8798f64b4b6c","deepnote_cell_type":"markdown","deepnote_sorting_key":"7","deepnote_source":"## Visualize data\n\nDeepnote can visualize dataframes out-of-the-box. [You can learn more about chart blocks on our docs](https://docs.deepnote.com/features/chart-blocks).\n\nIf you want to do something more sophisticated, you can use visualization libraries like [Altair](https://deepnote.com/@allan-campopiano/Altair-42-8dafcd3e-bdad-45e9-b2ab-3572581ed41b) or [Plotly](https://deepnote.com/@deepnote/3D-network-visualisations-using-plotly-a18c5e37-a517-4b27-bfde-1fee94a5760f)."},"source":"## Visualize data\n\nDeepnote can visualize dataframes out-of-the-box. [You can learn more about chart blocks on our docs](https://docs.deepnote.com/features/chart-blocks).\n\nIf you want to do something more sophisticated, you can use visualization libraries like [Altair](https://deepnote.com/@allan-campopiano/Altair-42-8dafcd3e-bdad-45e9-b2ab-3572581ed41b) or [Plotly](https://deepnote.com/@deepnote/3D-network-visualisations-using-plotly-a18c5e37-a517-4b27-bfde-1fee94a5760f)."},{"block_group":"4e7e177090a4465f9302a7b9c8919579","cell_type":"code","execution_count":null,"metadata":{"execution_start":1656011533127,"execution_millis":747,"source_hash":"c81a496","deepnote_variable_name":"df","deepnote_visualization_spec":{"data":{"name":"placeholder"},"mark":{"type":"line","tooltip":true},"height":220,"$schema":"https://vega.github.io/schema/vega-lite/v4.json","autosize":{"type":"fit"},"encoding":{"x":{"sort":null,"type":"temporal","field":"_time","scale":{"type":"linear","zero":false}},"y":{"sort":null,"type":"quantitative","field":"_value","scale":{"type":"linear","zero":false}},"color":{"sort":null,"type":"nominal","field":"sensor_id","scale":{"type":"linear","zero":false}}}},"cell_id":"4e7e177090a4465f9302a7b9c8919579","deepnote_to_be_reexecuted":false,"deepnote_block_group":"4e7e177090a4465f9302a7b9c8919579","deepnote_cell_type":"visualization","deepnote_sorting_key":"8","deepnote_content_hash":"c81a496","deepnote_execution_started_at":"2022-06-23T19:12:13.127Z","deepnote_execution_finished_at":"2022-06-23T19:12:13.874Z","deepnote_source":""},"outputs":[{"output_type":"execute_result","execution_count":4,"data":{"text/html":"\n
\n","text/plain":"alt.Chart(...)"},"metadata":{}}],"source":"_dntk.DeepnoteChart(df, '{\"data\":{\"name\":\"placeholder\"},\"mark\":{\"type\":\"line\",\"tooltip\":true},\"height\":220,\"$schema\":\"https://vega.github.io/schema/vega-lite/v4.json\",\"autosize\":{\"type\":\"fit\"},\"encoding\":{\"x\":{\"sort\":null,\"type\":\"temporal\",\"field\":\"_time\",\"scale\":{\"type\":\"linear\",\"zero\":false}},\"y\":{\"sort\":null,\"type\":\"quantitative\",\"field\":\"_value\",\"scale\":{\"type\":\"linear\",\"zero\":false}},\"color\":{\"sort\":null,\"type\":\"nominal\",\"field\":\"sensor_id\",\"scale\":{\"type\":\"linear\",\"zero\":false}}}}', filters='[]')"},{"block_group":"6602508c9ee349489803bb9bc20088ab","cell_type":"markdown","execution_count":null,"metadata":{"deepnote_cell_height":358.984375,"tags":[],"cell_id":"6602508c9ee349489803bb9bc20088ab","owner_user_id":"fb4d863f-e14b-4cec-a271-8335944bc775","deepnote_block_group":"6602508c9ee349489803bb9bc20088ab","deepnote_cell_type":"markdown","deepnote_sorting_key":"9","deepnote_source":"### Next steps\n\nRather than use our InfluxDB instance, you can query your own.\n\n1. **Generate your own token**. [Create an InfluxDB token](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token/), so this notebook can access your data.\n1. **Change `INFLUXDB_TOKEN` to your token**. To keep it secure, you can store it as an [environment variable](https://docs.deepnote.com/environment/environment-variables).\n1. **Change `INFLUXDB_ORG` to the name of your organization**. [Here is how you can find it](https://docs.influxdata.com/influxdb/v2.2/organizations/view-orgs/).\n1. **Change `INFLUXDB_URL` to the URL of your InfluxDB instance**.\n1. **Click the \"Run notebook\" button at the top of this window**. All of your new code will run from top to bottom.\n1. **Share your notebook with your team**. You can even turn your charts [into a shareable dashboard](https://docs.deepnote.com/collaboration/publishing-a-notebook).\n\n_Want to know more about using Deepnote?_ [Check out or docs](https://docs.deepnote.com/). \n_Want to know more about InfluxDB's Python client?_ [Read the influx-client-python docs](https://github.com/influxdata/influxdb-client-python).\n\nYou can safely delete this block (and any text block) once you're done with it."},"source":"### Next steps\n\nRather than use our InfluxDB instance, you can query your own.\n\n1. **Generate your own token**. [Create an InfluxDB token](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token/), so this notebook can access your data.\n1. **Change `INFLUXDB_TOKEN` to your token**. To keep it secure, you can store it as an [environment variable](https://docs.deepnote.com/environment/environment-variables).\n1. **Change `INFLUXDB_ORG` to the name of your organization**. [Here is how you can find it](https://docs.influxdata.com/influxdb/v2.2/organizations/view-orgs/).\n1. **Change `INFLUXDB_URL` to the URL of your InfluxDB instance**.\n1. **Click the \"Run notebook\" button at the top of this window**. All of your new code will run from top to bottom.\n1. **Share your notebook with your team**. You can even turn your charts [into a shareable dashboard](https://docs.deepnote.com/collaboration/publishing-a-notebook).\n\n_Want to know more about using Deepnote?_ [Check out or docs](https://docs.deepnote.com/). \n_Want to know more about InfluxDB's Python client?_ [Read the influx-client-python docs](https://github.com/influxdata/influxdb-client-python).\n\nYou can safely delete this block (and any text block) once you're done with it."},{"cell_type":"markdown","source":"\nCreated in deepnote.com\nCreated in Deepnote","metadata":{"created_in_deepnote_cell":true,"deepnote_cell_type":"markdown"}}],"metadata":{"deepnote_notebook_id":"9602717eff964f24b9ff0df70e27fe1c","deepnote_notebook_name":"notebook"},"nbformat":4,"nbformat_minor":0}