Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haskell-github/github
The github API for Haskell
https://github.com/haskell-github/github
github-api haskell rest-api
Last synced: 1 day ago
JSON representation
The github API for Haskell
- Host: GitHub
- URL: https://github.com/haskell-github/github
- Owner: haskell-github
- License: bsd-3-clause
- Created: 2011-10-30T22:38:34.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T02:05:14.000Z (9 months ago)
- Last Synced: 2024-04-14T03:16:24.154Z (7 months ago)
- Topics: github-api, haskell, rest-api
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/github
- Size: 1.33 MB
- Stars: 400
- Watchers: 14
- Forks: 190
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome - haskell-github/github - api,haskell,rest-api pushed_at:2024-10 star:0.4k fork:0.2k The github API for Haskell (Haskell)
README
GitHub
------[![Hackage version](https://img.shields.io/hackage/v/github.svg?label=Hackage&color=informational)](http://hackage.haskell.org/package/github)
[![github on Stackage Nightly](https://stackage.org/package/github/badge/nightly)](https://stackage.org/nightly/package/github)
[![Stackage LTS version](https://www.stackage.org/package/github/badge/lts?label=Stackage)](https://www.stackage.org/package/github)
[![Haskell-CI](https://github.com/haskell-github/github/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/haskell-github/github/actions/workflows/haskell-ci.yml)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:
```cabal
Build-depends: github
```Or from the command line:
```sh
cabal v1-install github
```Example Usage
=============See the samples in the
[samples/](https://github.com/haskell-github/github/tree/master/samples) directory.Note: some samples might be outdated.
Documentation
=============For details see the reference [documentation on Hackage][hackage].
Each module lines up with the hierarchy of
[documentation from the GitHub API](https://docs.github.com/en/rest).Request functions (ending with `R`) construct a data type which 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/`](https://github.com/haskell-github/github/tree/master/samples) directory.```hs
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}import Prelude.Compat
import Data.Text (Text, pack)
import Data.Text.IO as T (putStrLn)
import Data.Monoid ((<>))import GitHub (github')
import qualified GitHubmain :: IO ()
main = do
possibleUsers <- github' GitHub.usersFollowingR "phadej"
T.putStrLn $ either (("Error: " <>) . pack . show)
(foldMap ((<> "\n") . formatUser))
possibleUsersformatUser :: GitHub.SimpleUser -> Text
formatUser = GitHub.untagName . GitHub.simpleUserLogin
```Contributions
=============Please see
[CONTRIBUTING.md](https://github.com/haskell-github/github/blob/master/CONTRIBUTING.md)
for details on how you can help.Copyright
=========Copyright 2011-2012 Mike Burns.
Copyright 2013-2015 John Wiegley.
Copyright 2016-2019 Oleg Grenrus.Available under the BSD 3-clause license.
[hackage]: https://hackage.haskell.org/package/github "Hackage"
Alternative
===========Library [`github-rest`](https://hackage.haskell.org/package/github-rest)
also provides an interface to the GitHub API.
It compares itself to `github` here:
https://github.com/LeapYear/github-rest#comparison-to-other-libraries