XPAN::Query - Query a {CPAN,MiniCPAN,DarkPAN} mirror
This document describes version 0.04 of XPAN::Query (from Perl distribution XPAN-Query), released on 2014-06-06.
use XPAN::Query qw( list_xpan_packages list_xpan_modules list_xpan_dists list_xpan_authors ); my $res = list_ubuntu_releases(detail=>1); # raw data is in $Ubuntu::Releases::data;
XPAN is a term I coined for any repository (directory tree, be it on a local filesystem or a remote network) that has structure like a CPAN mirror, specifically having a modules/02packages.details.txt.gz file. This includes a normal CPAN mirror, a MiniCPAN, or a DarkPAN. Currently it excludes BackPAN, because it does not have 02packages.details.txt.gz, only authors/id/C/CP/CPANID directories.
modules/02packages.details.txt.gz
02packages.details.txt.gz
authors/id/C/CP/CPANID
With this module, you can query various things about the repository. This module fetches 02packages.details.txt.gz and parses it (caching it locally for a period of time).
List authors in {CPAN,MiniCPAN,DarkPAN} mirror.
Arguments ('*' denotes required arguments):
cache_period => int (default: 86400)
detail => bool
If set to true, will return array of records instead of just ID's.
query => str
Search query.
temp_dir => str
url* => str
URL to repository, e.g. '/cpan' or 'http://host/cpan'.
Return value:
List distributions in {CPAN,MiniCPAN,DarkPAN} mirror.
For simplicity and performance, this module parses distribution names from tarball filenames mentioned in 02packages.details.txt.gz, so it is not perfect (some release tarballs, especially older ones, are not properly named). For more proper way, one needs to read the metadata file (*.meta) for each distribution.
*.meta
author => str
Filter by author.
List packages in {CPAN,MiniCPAN,DarkPAN} mirror.
dist => str
Filter by distribution.
Parse::CPAN::Packages is a more full-featured and full-fledged module to parse 02packages.details.txt.gz. The downside is, startup and performance is slower.
Parse::CPAN::Packages::Fast is created as a more lightweight alternative to Parse::CPAN::Packages.
PAUSE::Packages also parses 02packages.details.txt.gz, it's just that the interface is different.
PAUSE::Users parses authors/00whois.xml. XPAN::Query does not parse this file, it is currently not generated/downloaded by CPAN::Mini, for example.
authors/00whois.xml
Tangentially related: BackPAN::Index
Please visit the project's homepage at https://metacpan.org/release/XPAN-Query.
Source repository is at https://github.com/sharyanto/perl-XPAN-Query.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=XPAN-Query
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2014 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install XPAN::Query, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XPAN::Query
CPAN shell
perl -MCPAN -e shell install XPAN::Query
For more information on module installation, please visit the detailed CPAN module installation guide.