cljdoc

https://cljdoc.org/ & https://github.com/cljdoc/cljdoc
jaihindhreddy 2019-05-08T13:46:02.019500Z

Can I access the documentation data behind cljdoc through an API somehow?

jaihindhreddy 2019-05-08T13:46:43.020500Z

More precisely, looking for a way to get a seq of namespaces contained in an artefact (identified by a coordinate, leiningen or deps.edn)

dominicm 2019-05-08T13:51:43.020600Z

@jaihindh.reddy for the purposes of documentation or otherwise?

dominicm 2019-05-08T13:51:56.020700Z

uh @jaihindh.reddy I guess instead. There's two.

martinklepsch 2019-05-08T15:07:51.023400Z

@jaihindhreddy there’s no API as such but if you tell us a bit more about what you’re trying to achieve maybe we can figure something out

jaihindhreddy 2019-05-08T16:43:38.024800Z

Check this deps.edn out:

{:deps {clj-time {:mvn/version "0.15.1"}
        org.clojure/data.json {:mvn/version "0.2.6"}
        clj-http {:mvn/version "3.9.1"}
        org.clojure/test.check {:mvn/version "0.10.0-alpha4"}}}
I want to write a function that takes the above data structure, and returns this:
{[clj-time {:mvn/version "0.15.1"}] [clj-time.coerce clj-time.core clj-time.format clj-time.instant clj-time.internal.fn clj-time.jdbc clj-time.local clj-time.periodic clj-time.predicates clj-time.spec clj-time.types]
 [org.clojure/data.json {:mvn/version "0.2.6"}] [clojure.data.json]
 [clj-http {:mvn/version "3.9.1"}] [clj-http.client clj-http.conn-mgr clj-http.cookies clj-http.core clj-http.core-old clj-http.headers clj-http.links clj-http.multipart clj-http.util]
 [org.clojure/test.check {:mvn/version "0.10.0-alpha4"}] [clojure.test.check]}

martinklepsch 2019-05-08T16:45:58.025500Z

so you want to provide a list of artifacts and get that list back with namespaces in those artifacts attached to each?

jaihindhreddy 2019-05-08T17:06:05.025700Z

Exactly.

martinklepsch 2019-05-08T17:35:37.027300Z

So there's no API as such currently. It wouldn't be too hard to build something but I'd kind of like to get it right instead of adding random API endpoints. Which reminds me of some previous discussions of adding a GraphQL API for the data on cljdoc.

👍 2