Fork me on GitHub
#cljdoc
<
2019-05-08
>
jaihindhreddy13:05:02

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

jaihindhreddy13:05:43

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

dominicm13:05:43

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

dominicm13:05:56

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

martinklepsch15:05:51

@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

jaihindhreddy16:05:38

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]}

martinklepsch16:05:58

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

martinklepsch17:05:37

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.

👍 8