gargantext-0.0.7.1.5.3: Search, map, share
Copyright(c) CNRS 2017-Present
LicenseAGPL + CECILL v3
Maintainerteam@gargantext.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gargantext.API.Ngrams.List

Description

 
Synopsis

Documentation

type GETAPI = Summary "Get List" :> ("lists" :> (Capture "listId" ListId :> (("json" :> Get '[JSON, HTML] (Headers '[Header "Content-Disposition" Text] NgramsList)) :<|> (("json.zip" :> Get '[ZIP] (Headers '[Header "Content-Disposition" Text] NgramsListZIP)) :<|> ("csv" :> Get '[CSV] (Headers '[Header "Content-Disposition" Text] NgramsTableMap)))))) #

type JSONAPI = Summary "Update List" :> ("lists" :> (Capture "listId" ListId :> ("add" :> ("form" :> ("async" :> AsyncJobs JobLog '[FormUrlEncoded] WithJsonFile JobLog))))) #

getJson :: HasNodeStory env err m => ListId -> m (Headers '[Header "Content-Disposition" Text] NgramsList) #

getJsonZip :: HasNodeStory env err m => ListId -> m (Headers '[Header "Content-Disposition" Text] NgramsListZIP) #

getCsv :: HasNodeStory env err m => ListId -> m (Headers '[Header "Content-Disposition" Text] NgramsTableMap) #

type CSVAPI = Summary "Update List (legacy v3 CSV)" :> ("lists" :> (Capture "listId" ListId :> ("csv" :> ("add" :> ("form" :> ("async" :> AsyncJobs JobLog '[FormUrlEncoded] WithTextFile JobLog)))))) #

ngramsListFromCSVData :: Text -> Either String NgramsList #

Tries converting a text file into an NgramList, so that we can reuse the existing JSON endpoint for the CSV upload.

csvToNgramsTableMap :: Record -> Parser NgramsTableMap #

Converts a plain CSV Record into an NgramsTableMap

importCsvFile :: forall env err m. (HasNodeStory env err m, HasServerError err, MonadJobStatus m) => ListId -> FilePath -> m () #

This is for debugging the CSV parser in the REPL