docs-v2/content/flux/v0/stdlib/experimental/csv/from.md

2.2 KiB

title description menu weight
csv.from() function `csv.from()` retrieves [annotated CSV](/influxdb/v2/reference/syntax/annotated-csv/) **from a URL**.
flux_v0_ref
name parent identifier
csv.from experimental/csv experimental/csv/from
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")