Am 23.05.2016 um 17:13 schrieb Russel Winder via Digitalmars-d-announce:
On Mon, 2016-05-23 at 15:19 +0200, Sönke Ludwig via Digitalmars-d-
announce wrote:
Am 23.05.2016 um 15:01 schrieb Russel Winder via Digitalmars-d-
announce:
Hi,

Is the Dub API published anywhere. I propose to write a dmd/ldc/gdc
subtool so that dependency management based on the Dub repository
is
provided for SCons D builds.


Online docs are still on the TODO list, but you can do

      dub fetch dub
      dub run dub -b ddox

And it will start up a local HTTP server on http://127.0.0.1:8080/
with
the API documentation.

I think I have not expressed my needs as I intended. The above is about
the code that runs, I am more interested in the way of interacting with
a running server. I appreciate this latter is (sort of) contained in
the former, but I think they are two different needs and so require
different documentation.  It sounds as though all forms of
documentation are on the "not done yet" which is understandable.

My need is two write a Python program that queries the running Dub
repository. So I am guessing this is an HTTP-based protocol.

I guess I will have to read the Dub code and deduce/infer/guess the
necessary protocol. Not a problem, but it would have been easier for me
not to have to do this but to have the API. Is there a repository with
the beginnings of something that I might contribute to?


Oh, okay, misunderstood that. The basic protocol is very simple:

GET /packages/index.json
Yields a JSON array with all package names

GET /packages/[package].json
Returns a JSON object with general information about a package, including all available versions

GET /packages/[package]/[version].json
Returns a JSON object with the package recipe of a particular version (dub.json format), augmented with some additional fields

GET /packages/[package]/[version].zip
Yields a zipped up version of the package


There is also a separate search API (and some other less interesting APIs):

GET /api/packages/search?q=...


We should really get that written down on a web page...

Reply via email to