NAME

Dist::Data - API to access the data of a Perl distribution file or directory

VERSION

version 0.007

SYNOPSIS

use Dist::Data;

my $dist = Dist::Data->new('My-Sample-Distribution-0.003.tar.gz');

# Extract files into this directory, if it not already contains a distribution
my $otherdist = Dist::Data->new({
  dir => '/storage/extracted-dists/My-Sample-Distribution-0.003',
  filename => 'My-Sample-Distribution-0.003.tar.gz',
});

my $otherdist_via_dir = Dist::Data->new({
  dir => '/storage/extracted-dists/My-Sample-Distribution-0.003',
});

my %files = %{$dist->files};

my $filename_of_distini = $dist->file('dist.ini');

# gives back CPAN::Meta if the dist has one
my $cpan_meta = $dist->cpan_meta;
# alternative $dist->cm;

my $version = $dist->version; # handled by CPAN::Meta object
my $name = $dist->name;       # also

my @authors = $dist->authors;

my %packages = %{$dist->packages};             # via Dist::Metadata
my %namespaces = %{$dist->namespaces};         # via Module::Metadata
my %documentations = %{$dist->documentations}; # only .pod inside of lib/ (so far)
my %scripts = %{$dist->scripts};               # all files in bin/ and script/

DESCRIPTION

This distribution is used to get all information from a CPAN distribution or an extracted CPAN distribution. It tries to combine the power of other modules. Longtime it should be possible to define alternative behaviour (to be more like search.cpan.org or be like metacpan.org or whatever other system that parses CPAN Distributions).

SUPPORT

IRC

Join #perl-help on irc.perl.org. Highlight Getty for fast reaction :).

Repository

http://github.com/Getty/p5-dist-data
Pull request and additional contributors are welcome

Issue Tracker

http://github.com/Getty/p5-dist-data/issues

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudss.us/

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by Torsten Raudssus <torsten@raudssus.de> https://raudss.us/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.