github: Access to the GitHub API, v3.

[ bsd3, library, network ] [ Propose Tags ]

The GitHub API provides programmatic access to the full GitHub Web site, from Issues to Gists to repos down to the underlying git data like references and trees. This library wraps all of that, exposing a basic but Haskell-friendly set of functions and data structures.

For supported endpoints see GitHub module.

import qualified GitHub as GH

main :: IO ()
main = do
    possibleUser <- GH.executeRequest' $ GH.userInfoR "phadej"
    print possibleUser

For more of an overview please see the README: https://github.com/phadej/github/blob/master/README.md


[Skip to Readme]

Modules

[Last Documentation]

  • GitHub
    • GitHub.Auth
    • GitHub.Data
      • GitHub.Data.Comments
      • GitHub.Data.Content
      • GitHub.Data.Definitions
      • GitHub.Data.Gists
      • GitHub.Data.GitData
      • GitHub.Data.Id
      • GitHub.Data.Issues
      • GitHub.Data.Name
      • GitHub.Data.PullRequests
      • GitHub.Data.Repos
      • GitHub.Data.Request
      • GitHub.Data.Search
      • GitHub.Data.Teams
      • GitHub.Data.Webhooks
        • GitHub.Data.Webhooks.Validate
    • Endpoints
      • Activity
        • GitHub.Endpoints.Activity.Starring
        • GitHub.Endpoints.Activity.Watching
      • GitHub.Endpoints.Gists
        • GitHub.Endpoints.Gists.Comments
      • GitData
        • GitHub.Endpoints.GitData.Blobs
        • GitHub.Endpoints.GitData.Commits
        • GitHub.Endpoints.GitData.References
        • GitHub.Endpoints.GitData.Trees
      • GitHub.Endpoints.Issues
        • GitHub.Endpoints.Issues.Comments
        • GitHub.Endpoints.Issues.Events
        • GitHub.Endpoints.Issues.Labels
        • GitHub.Endpoints.Issues.Milestones
      • GitHub.Endpoints.Organizations
        • GitHub.Endpoints.Organizations.Members
        • GitHub.Endpoints.Organizations.Teams
      • GitHub.Endpoints.PullRequests
        • GitHub.Endpoints.PullRequests.ReviewComments
      • GitHub.Endpoints.Repos
        • GitHub.Endpoints.Repos.Collaborators
        • GitHub.Endpoints.Repos.Comments
        • GitHub.Endpoints.Repos.Commits
        • GitHub.Endpoints.Repos.Forks
        • GitHub.Endpoints.Repos.Webhooks
      • GitHub.Endpoints.Search
      • GitHub.Endpoints.Users
        • GitHub.Endpoints.Users.Followers
    • GitHub.Request

Flags

Automatic Flags
NameDescriptionDefault
aeson-compat

Whether to use aeson-compat or aeson-extra

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.1, 0.1.2, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.4.1, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.8, 0.9, 0.10.0, 0.11.0, 0.11.1, 0.12, 0.13, 0.13.1, 0.13.2, 0.14.0, 0.14.1, 0.15.0, 0.16.0, 0.17.0, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.28.0.1, 0.29
Dependencies aeson (>=0.7.0.6 && <0.11), aeson-compat (>=0.3.0.0 && <0.4), aeson-extra (>=0.2.0.0 && <0.3), attoparsec (>=0.11.3.4 && <0.14), base (>=4.7 && <4.9), base-compat (>=0.6.0 && <0.10), base16-bytestring (>=0.1.1.6 && <0.2), binary (>=0.7.1.0 && <0.9), binary-orphans (>=0.1.0.0 && <0.2), byteable (>=0.1.1 && <0.2), bytestring (>=0.10.4.0 && <0.11), containers (>=0.5.5.1 && <0.6), cryptohash (>=0.11 && <0.12), deepseq (>=1.3.0.2 && <1.5), deepseq-generics (>=0.1.1.2 && <0.3), exceptions (>=0.8.0.2 && <0.9), hashable (>=1.2.3.3 && <1.3), http-client (>=0.4.8.1 && <0.5), http-client-tls (>=0.2.2 && <0.3), http-link-header (>=1.0.1 && <1.1), http-types (>=0.8.6 && <0.10), iso8601-time (>=0.1.4 && <0.2), mtl (>=2.1.3.1 && <2.3), network-uri (>=2.6.0.3 && <2.7), semigroups (>=0.16.2.2 && <0.19), text (>=1.2.0.6 && <1.3), time (>=1.4 && <1.7), transformers (>=0.3.0.0 && <0.6), transformers-compat (>=0.4.0.3 && <0.6), unordered-containers (>=0.2 && <0.3), vector (>=0.10.12.3 && <0.12), vector-instances (>=3.3.0.1 && <3.4) [details]
License BSD-3-Clause
Copyright Copyright 2012-2013 Mike Burns, Copyright 2013-2015 John Wiegley, Copyright 2016 Oleg Grenrus
Author Mike Burns, John Wiegley, Oleg Grenrus
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Category Network
Home page https://github.com/phadej/github
Source repo head: git clone git://github.com/phadej/github.git
Uploaded by phadej at 2016-01-25T07:54:24Z
Distributions Debian:0.23, LTSHaskell:0.29, NixOS:0.29, Stackage:0.29
Reverse Dependencies 11 direct, 0 indirect [details]
Downloads 36034 total (115 in the last 30 days)
Rating 2.0 (votes: 5) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-28 [all 2 reports]

Readme for github-0.14.0

[back to package description]

Github

The Github API v3 for Haskell.

Some functions are missing; these are functions where the Github API did not work as expected. The full Github API is in beta and constantly improving.

Installation

In your project's cabal file:

-- Packages needed in order to build this package.
Build-depends:       github

Or from the command line:

cabal install github

Example Usage

See the samples in the samples/ directory.

Documentation

For details see the reference documentation on Hackage.

Each module lines up with the hierarchy of documentation from the Github API.

Request functions (ending with R) construct a data type with can be executed in IO by executeRequest functions. They are all listed in the root GitHub module.

IO functions produce an IO (Either Error a), where a is the actual thing you want. You must call the function using IO goodness, then dispatch on the possible error message. Here's an example from the samples:

Many function have samples under samples/ directory.

import qualified GitHub.Endpoints.Users.Followers as Github

main = do
    possibleUsers <- GitHub.usersFollowing "mike-burns"
    T.putStrLn $ either (("Error: " <>) . T.pack . show)
                        (foldMap (formatUser . (<> "\n")))
                        possibleUsers

formatUser = GitHub.untagName . GitHub.githubOwnerLogin

Test setup

To run integration part of tests, you'll need github access token Token is needed, because unauthorised access is highly limited. It's enough to add only basic read access for public information.

With travis encrypt --org --repo yournick/github "GITHUB_TOKEN=yourtoken" command you get a secret, you can use in your travis setup to run the test-suite there.

Contributions

Please see CONTRIBUTING.md for details on how you can help.

Copyright

Copyright 2011-2012 Mike Burns. Copyright 2013-2015 John Wiegley. Copyright 2016 Oleg Grenrus.

Available under the BSD 3-clause license.