Perl Perl6
Failed to load latest commit information.
examples Adds examples/ Sep 13, 2016
lib Fix typo Sep 3, 2016
t Fixes typos. Jan 12, 2016
.gitignore Update gitignore. Jan 21, 2013
.travis.yml Revert back to <= 5.21 - Perl @ Travis Jul 6, 2015
Changes v0.01033 Jan 22, 2016 Updates Changes prior to release. Jan 22, 2016
dist.ini Adds Git::Push to dzil plugins. Jan 22, 2016

Build Status Coverage Status


Pithub - Github v3 API


version 0.01033


use Pithub;
use Data::Dumper;

my $p = Pithub->new;
# my $p = Pithub->new(utf8 => 0); # enable compatibility options for version 0.01029 or lower
my $result = $p->repos->get( user => 'plu', repo => 'Pithub' );

# $result->content is either an arrayref or an hashref
# depending on the API call that has been made
printf "%s\n", $result->content->{html_url};     # prints
printf "%s\n", $result->content->{clone_url};    # prints

# if the result is an arrayref, you can use the result iterator
my $result = $p->repos->list( user => 'plu' );
while ( my $row = $result->next ) {
    printf "%s\n", $row->{name};

# Connect to your local GitHub Enterprise instance
my $p = Pithub->new(
    api_uri => ''

# No need to provide user/repo to each module:
my $pit = Pithub->new(
  user  => $user,
  repo  => $repo,
  token => $oauth_token,



Pithub (Perl + Github) provides a set of modules to access the Github v3 API in an object oriented way. There is also Net::GitHub which does the same for all the versions (v1, v2, v3) of the Github API. Pithub supports all API calls so far, but only for v3.



my $p = Pithub->new({ search_api => 'v3' });
my $search = $p->search; # $search->isa('Pithub::SearchV3');

This attribute allows the default for the API to use for searches to be specified. The two accepted values are v3 and legacy. For compatibility reasons the default is legacy.



Provides access to Pithub::Events.


Provides access to Pithub::Gists.


Provides access to Pithub::GitData.


Provides access to Pithub::Issues.


Provides access to Pithub::Orgs.


Provides access to Pithub::PullRequests.


Provides access to Pithub::Repos.


my $legacy_search  = $p->search(search_api => 'legacy');
my $v3_search      = $p->search(search_api => 'v3');
my $default_search = $p->search;

Provides access to Pithub::Search and Pithub::SearchV3. When no search_api option is given, the value provided by the search_api attribute is used.


Provides access to Pithub::Users.


Quite a lot of the Pithub documentation has been taken directly from the great API documentation at Github. Please also read the documentation there, since it might be more complete and more up-to-date.

Pithub::Base contains documentation for attributes inherited by all Pithub modules.


Pithub as well as the Github v3 API are still under development. So there might be things broken on both sides. Besides that it's possible that the API will change. This applies to Pithub itself as well as the Github v3 API.


This module is hosted on Github, so feel free to fork it and send pull requests. There are two different kinds of test suites, one is just checking the HTTP requests that are created by the method calls, without actually sending them. The second one is sending real requests to the Github API. If you want to contribute to this project, I highly recommend to run the live tests on a test account, because it will generate a lof of activity.


There are different ways of using the Pithub library. You can either use the main module Pithub to get access to all other modules, like Pithub::Repos for example. Or you can use Pithub::Repos directly and create an instance of it. All modules accept the same attributes, either in the constructor or later by calling the setters.

Besides that there are other modules involved. Every method call which maps directly to a Github API call returns a Pithub::Result object. This contains everything interesting about the response returned from the API call.

Pithub::Base might be interesting for two reasons:


  • Andreas Marienborg
  • Alessandro Ghedini
  • Michael G Schwern


Johannes Plunien <>


This software is copyright (c) 2011 by Johannes Plunien.

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