Skip to content

Conversation

@daveliepmann
Copy link
Contributor

@daveliepmann daveliepmann commented May 24, 2020

Per read-csv's docstring, parameter uri should be able to be a Reader such as from clojure.java.io/reader. This PR makes that possible. My use case is something like:

(with-open [rdr (io/reader (io/resource "iris.csv"))]
  (doall (csv/read-csv rdr {:fields [:sepal-length :sepal-width
                                     :petal-length :petal-width
                                     :species]})))

Ideally meta-csv would accept java.net.URL so that the resource could be read directly, but that isn't currently listed as an acceptable parameter. But adding (instance? java.net.URL uri) to this or would actually solve my use case more directly.

(I did not look into InputStreams but there may be a similar issue there.)

Per docstring, `uri` should accept Readers like from
clojure.java.io/reader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant