Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Links as an API Property #198

Open
thecliguy opened this issue Oct 7, 2022 · 7 comments
Open

Expose Links as an API Property #198

thecliguy opened this issue Oct 7, 2022 · 7 comments

Comments

@thecliguy
Copy link

The results returned by the repology website includes "Links(s)" when querying a project like so: https://repology.org/project/<NAME>/packages

Would it be possible to expose "Links(s)" as a property of the results returned when querying via the API?

Also, what is the significance of the "(s)" in "Links(s)"? Is is just a typo? Is it supposed to say "Link(s)"?

AMDmi3 added a commit that referenced this issue Oct 7, 2022
@AMDmi3
Copy link
Member

AMDmi3 commented Oct 7, 2022

Would it be possible to expose "Links(s)" as a property of the results returned when querying via the API?

What's your usecase? It's possiblt, but it'll require specific API, as including the links with existing API would be too heavy.

Also, what is the significance of the "(s)" in "Links(s)"? Is is just a typo? Is it supposed to say "Link(s)"?

Fixed, thank you!

@thecliguy
Copy link
Author

What's your usecase? It's possiblt, but it'll require specific API, as including the links with existing API would be too heavy.

I was particularly interested in returning the "Upstream homepage" link as a means of deriving whether a package is aligned with an original repo or a fork.

@AMDmi3
Copy link
Member

AMDmi3 commented Oct 7, 2022

This is often not reliable, as homepage link usually remains the same when package switches to the fork. Download links would be more reliable but not many repositories provide them. Do you need this for one time or you need continuous availability of data? Do you need this for specific repo?

This looks too specific for a dedicated API, but it's possible to revive https://github.com/repology/repology-exports and set up daily export.

@thecliguy
Copy link
Author

This is often not reliable, as homepage link usually remains the same when package switches to the fork. Download links would be more reliable but not many repositories provide them.

Ahh, OK, that makes sense to use the Upstream Download link (when avaiable) as a more reliable source of data. Thank you for that tip.

Do you need this for one time or you need continuous availability of data? Do you need this for specific repo?

Occasionally I will check the state of packages for ssh-audit. I'm not a maintainer of the project, just an occasional contributor.

This is just a thought (and perhaps a naive one)... You mentioned that exposing links would make the API too heavy... What if when calling the API it was to accept an optional boolean showlinks=1 so that links are only returned if explicitly requested? Another thought... Could the links data that's served be cached on the backend to reduce DB load?

@darkdragon-001
Copy link

I would be interested in Package Page links to display nice links for users with an easy way to install. As an alternative I could probably generate "Install links" directly. Which property is the name used to install a package? Is it visiblename? E.g. apt-get install PACKAGE.

@AMDmi3
Copy link
Member

AMDmi3 commented Nov 23, 2022

@thecliguy unfortunately no, the very possibility to request links would allow excess load on the server. And no, links cannot be cached - it's the heaviest table in repology database, and different packages are requested each time, so it'd be a waste of memory.

@AMDmi3
Copy link
Member

AMDmi3 commented Nov 23, 2022

@darkdragon-001 no, it is binname, sometimes srcname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants