#5547 API for searching repos
Closed: Fixed Opened by cqi.

There are several front-ends package tools built on top of rpkg, which work with dist-git for packagers. To be more friendly for packagers and newbies, rather than opening a browser and go to pkgs.*.org, for example pkgs.fedoraproject.org/cgit/, it would be much handy to make those front-ends be able to search from dist-git to discover repositories they are interested in. It would be done by

fedpkg search python

as a result, all repositories that contains keyword python will be shown. Furthermore, this could also support to search by namespace.

An API provided by dist-git to search repositories will benefit package tools and make above feature possible. I'm not sure whether dist-git has any APIs currently that could be used for the search feature.


fedpkg search could call pkgdb's API

I am not sure dist-git would be the best place for this as it would/could also return repos that are no longer available/maintained while pkgdb won't and should be anyway a 1:1 mapping of what's in dist git.

@pingou

What does "no longer available" mean here, retired or something else?

Does /api/packages/ only list packages that are not retired?

What does "no longer available" mean here, retired or something else?

Retired yes

Does /api/packages/ only list packages that are not retired?

Not by default but it can be asked to: https://admin.fedoraproject.org/pkgdb/api/#list_packages

Not by default but it can be asked to: https://admin.fedoraproject.org/pkgdb/api/#list_packages

This link is just the /api/packages/. Which argument can be used to filter out retired packages?

This link lists all the arguments that can be passed on to this API endpoint such as:
status: Allows to filter packages based on their status: Approved, Orphaned, Retired, Removed.

Oh, why didn't I notice this. :( Thanks for your time.

How to pass multiple status to status? I just tried https://admin.fedoraproject.org/pkgdb/api/packages/?status=Orphaned,Approved&pattern=python&count=True, but looks it doesn't work. I'd like to filter out Approved and Orphaned packages.

That would be it: https://admin.fedoraproject.org/pkgdb/api/packages/?&status=Approved&status=Orphaned&pattern=python&count=True

This is really really helpful. Thank you very much. :)

There is also pkgdb-cli if you want a CLI tool :)

So, should we close this now? Or is there anything more to do here?

@kevin Sure. Please close this issue. Thanks.

@kevin changed the status to Closed

Metadata