CLI frontend to the Cloogle API
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
clooglecli.py
requirements.txt
setup.py

README.md

cloogle-cli

cloogle-cli is a commandline frontend for the Cloogle API. At the moment, it supports the full API functionality plus some extra. This frontend interacts with the HTTP API.

Installation

Simply run:

python setup.py install

clooglecli.py will be available in your path. This package is not yet avaliable through PyPI.

Usage

clooglecli.py [OPTIONS] <searchstring>

Some examples:

$ clooglecli.py hd

------------------  --------------------------------------------
StdList             hd :: ([a] -> a)
Data.Tuple          appThd3 :: ((c -> d) (a, b, c) -> (a, b, d))
StdOverloadedList   Hd :: ((l e) -> e)
Data.Map            findWithDefault :: (a k (Map k a) -> a)
Data.IntMap.Strict  findWithDefault :: (a Int (IntMap a) -> a)
...
------------------  --------------------------------------------


$ clooglecli.py -U 'a -> String' ''

------------------  -------------------------------------------
genLibTest          show1 :: (a -> String)
GenPrint            printToString :: (a -> String)
Text.XML            toXMLString :: (a -> String)
Data.Serialization  serialize :: (a -> String)
Graphviz            digraphTitle :: (Digraph -> String)
...
------------------  -------------------------------------------


$ clooglecli.py catMaybes -m StdMaybe

--------  ----------------------------------------------------------
StdMaybe  catMaybes :: ([(Maybe a)] -> [a])
StdMaybe  mapMaybe :: ((x -> y) (Maybe x) -> (Maybe y))
StdMaybe  mapMaybe :: ((x -> y) (Maybe x) -> (Maybe y))
StdMaybe  accMaybe :: ((St x a) (Maybe x) -> ((Maybe a), (Maybe x)))
StdMaybe  listToMaybe :: ([a] -> (Maybe a))
...
--------  ----------------------------------------------------------

You can also search for classes or types by using 'class N' or 'type N' as your search query. E.g.:

$ clooglecli.py 'class List'

----  -------------------------------------
List  _cons :: .e u:(l .e) -> u:(l .e)
      _decons :: !u:(l .e) -> (.e,u:(l .e))
----  -------------------------------------

Available options

usage: cloogle-cli [-h] [-m MODULES] [-l LIB] [-u str] [--include_builtins]
                   [--include_core] [-v] [--table | --minimal]
                   [str]

positional arguments:
  str                   Search string

optional arguments:
  -h, --help            show this help message and exit
  -m MODULES, --mod MODULES
                        Comma-separated list of modules to search in
  -l LIB, --lib LIB     Comma-separated list of libraries to search in
  -u str, --unify str   Type search string
  --include_builtins    Include language builtins in search results
  --include_core        Include library cores in search results
  --include_apps        Include app modules in search results
  -v, --verbose         Verbosity (-v = info, -vv = debug

Output format:
  --table
  --minimal