2.2 KiB
2.2 KiB
title | description | menu | weight | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
csv.from() function | `csv.from()` retrieves [annotated CSV](/influxdb/v2/reference/syntax/annotated-csv/) **from a URL**. |
|
201 |
csv.from()
retrieves annotated CSV from a URL.
{{% warn %}}
Deprecated
Experimental csv.from()
is deprecated in favor of a combination of requests.get()
and csv.from()
.
{{% /warn %}}
Note: Experimental csv.from()
is an alternative to the standard
csv.from()
function.
Function type signature
(url: string) => stream[A] where A: Record
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
Parameters
url
({{< req >}}) URL to retrieve annotated CSV from.
Examples
Query annotated CSV data from a URL using the requests package
import "csv"
import "http/requests"
response = requests.get(url: "http://example.com/csv/example.csv")
csv.from(csv: string(v: response.body))
Query annotated CSV data from a URL
import "experimental/csv"
csv.from(url: "http://example.com/csv/example.csv")