Popularity
6.4
Growing
Activity
0.0
Stable
10
2
5

Monthly Downloads: 65
Programming language: Haskell
License: MIT License
Tags: Google     Unclassified    
Latest version: v0.4.1

google-drive alternatives and similar packages

Based on the "Unclassified" category

Do you think we are missing an alternative of google-drive or a related project?

Add another 'Unclassified' Package

README

Google Drive

Google Drive API access

Stability

As we are still pre-1.0, I consider all types and interfaces freely changeable in any way accompanied by only a minor version bump.

I apologize if this breaks your code. Update at your own risk.

Installation

% cabal install google-drive

Usage

-- Top level re-exports all the sub-modules
import Network.Google.Drive

import Control.Monad (forM_)
import Data.Conduit (($$+-))

main :: IO ()
main = do
    -- See my separate google-oauth2 library
    let token = undefined

    -- runApi would return an Either ApiError a
    -- runApi_ discards the a and raises any errors, useful in CLI apps
    runApi_ token $ do
        -- "root" is an alias for the ID of the Drive itself
        Just root <- getFile "root"

        -- Note: This is already available as listVisibleContents
        items <- listFiles $ (fileId root) `qIn` Parents ?&& Trashed ?= False

        forM_ items $ \item -> do
            let path = localPath item

            downloadFile item ($$+- sinkFile path)

See the tests and haddocks for more information.

Developing and Tests

% cp .env{.example,} # and edit it accordingly
% cabal install --dependencies-only --enable-tests -j
% cabal test