From: Catonano <catonano@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Package graph queries
Date: Thu, 11 Aug 2016 06:37:50 +0200 [thread overview]
Message-ID: <CAJ98PDzn9WjyNmHJnBh49Jzq0Q43gUB=25HCEEEq8C7UYtTh7g@mail.gmail.com> (raw)
In-Reply-To: <87twf6ahvj.fsf_-_@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]
2016-07-31 0:19 GMT+02:00 Ludovic Courtès <ludo@gnu.org>:
> Jelle Licht <jlicht@fsfe.org> skribis:
>
> > On Jul 29, 2016 16:53, "Catonano" <catonano@gmail.com> wrote:
>
> [...]
>
> >> For example: which are the packages with less or no dependencies (and a
> >> lot of dependants) ?
> >> Because those should be imported first, in my opinion.
>
> [...]
>
> > ^ This, I like. Does anyone have any suggestions on tools that could help
> > me do this in guile?
>
> I understand you want to perform these queries on NPM packages, not Guix
> packages, but if you could hook your NPM package representation in (guix
> graph)¹, you could do the same as this:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> ,use(guix graph)
> scheme@(guile-user)> ,use(guix scripts graph)
> scheme@(guile-user)> ,use(gnu packages)
> scheme@(guile-user)> ,use(guix monad-repl)
> scheme@(guile-user)> ,enter-store-monad
> store-monad@(guile-user) [1]> (node-back-edges %bag-node-type
> (fold-packages cons '()))
> $4 = #<procedure 59ac880 at guix/graph.scm:87:17 (node)>
> store-monad@(guile-user) [1]> ,q
> scheme@(guile-user)> ,use(srfi srfi-1)
> scheme@(guile-user)> (filter (lambda (p)
> (> (node-reachable-count (list p) $4)
> 600))
> (fold-packages cons '()))
>
My concern, here, would be an equivalent of "fold-packages" for
registry.npmjs.com.
The API seems a bit cloudy to me.
See this question
https://stackoverflow.com/questions/34071621/query-npmjs-registry-via-api
[-- Attachment #2: Type: text/html, Size: 2443 bytes --]
prev parent reply other threads:[~2016-08-11 4:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-24 1:06 [GSoC update] Npm & guix Jelle Licht
2016-07-25 8:41 ` Andy Wingo
2016-07-25 11:33 ` Jan Nieuwenhuizen
2016-07-25 21:26 ` Ludovic Courtès
2016-07-29 14:53 ` Catonano
2016-07-29 15:26 ` Jelle Licht
2016-07-30 22:19 ` Package graph queries Ludovic Courtès
2016-08-11 4:37 ` Catonano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ98PDzn9WjyNmHJnBh49Jzq0Q43gUB=25HCEEEq8C7UYtTh7g@mail.gmail.com' \
--to=catonano@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).