@yanick 

Most of https://github.com/CPAN-API/metacpan-web/blob/recommendations/lib/MetaCPAN/Web/Model/API/Recommendation.pm belongs here. See https://github.com/CPAN-API/cpan-api/blob/master/lib/MetaCPAN/Document/File.pm#L722 how to define functions on a set of documents.