{"id":26958595,"url":"https://github.com/minio/minio-hs","last_synced_at":"2025-04-03T04:20:23.433Z","repository":{"id":17385328,"uuid":"81812144","full_name":"minio/minio-hs","owner":"minio","description":"MinIO Client SDK for Haskell","archived":false,"fork":false,"pushed_at":"2025-01-31T20:48:52.000Z","size":686,"stargazers_count":49,"open_issues_count":15,"forks_count":31,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-02T00:37:49.000Z","etag":null,"topics":["aws-s3","cloud-storage","haskell","haskell-library","object-storage","s3","s3-bucket"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-13T10:19:42.000Z","updated_at":"2025-02-07T02:56:39.000Z","dependencies_parsed_at":"2025-01-31T21:24:41.487Z","dependency_job_id":"761c2185-89e6-4033-958f-4be2414a88cd","html_url":"https://github.com/minio/minio-hs","commit_stats":{"total_commits":211,"total_committers":10,"mean_commits":21.1,"dds":0.6208530805687205,"last_synced_commit":"f4ae55468e7d7aea9e89214a985ccb0dd9f4ddbf"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fminio-hs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fminio-hs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fminio-hs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minio%2Fminio-hs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minio","download_url":"https://codeload.github.com/minio/minio-hs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246842652,"owners_count":20842788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-s3","cloud-storage","haskell","haskell-library","object-storage","s3","s3-bucket"],"created_at":"2025-04-03T04:20:22.912Z","updated_at":"2025-04-03T04:20:23.416Z","avatar_url":"https://github.com/minio.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MinIO Haskell Client SDK for Amazon S3 Compatible Cloud Storage [![CI](https://github.com/minio/minio-hs/actions/workflows/ci.yml/badge.svg)](https://github.com/minio/minio-hs/actions/workflows/ci.yml)[![Hackage](https://img.shields.io/hackage/v/minio-hs.svg)](https://hackage.haskell.org/package/minio-hs)[![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io)\n\nThe MinIO Haskell Client SDK provides simple APIs to access [MinIO](https://min.io) and any Amazon S3 compatible object storage.\n\nThis guide assumes that you have a working [Haskell development environment](https://www.haskell.org/downloads/).\n\n## Installation\n\n### Add to your project\n\nSimply add `minio-hs` to your project's `.cabal` dependencies section or if you are using hpack, to your `package.yaml` file as usual.\n\n### Try it out in a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)\n\n#### For a cabal based environment\n\nDownload the library source and change to the extracted directory:\n\n``` sh\n$ cabal get minio-hs\n$ cd minio-hs-1.6.0/ # directory name could be different\n```\n\nThen load the `ghci` REPL environment with the library and browse the available APIs:\n\n``` sh\n$ cabal repl\nghci\u003e :browse Network.Minio\n```\n\n#### For a stack based environment\n\nFrom your home folder or any non-haskell project directory, just run:\n\n```sh\nstack install minio-hs\n```\n\nThen start an interpreter session and browse the available APIs with:\n\n```sh\n$ stack ghci\n\u003e :browse Network.Minio\n```\n\n## Examples\n\nThe [examples](https://github.com/minio/minio-hs/tree/master/examples) folder contains many examples that you can try out and use to learn and to help with developing your own projects.\n\n### Quick-Start Example - File Uploader\n\nThis example program connects to a MinIO object storage server, makes a bucket on the server and then uploads a file to the bucket.\n\nWe will use the MinIO server running at https://play.min.io in this example. Feel free to use this service for testing and development. Access credentials are present in the library and are open to the public.\n\n### FileUploader.hs\n``` haskell\n#!/usr/bin/env stack\n-- stack --resolver lts-14.11 runghc --package minio-hs --package optparse-applicative --package filepath\n\n--\n-- MinIO Haskell SDK, (C) 2017-2019 MinIO, Inc.\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not use this file except in compliance with the License.\n-- You may obtain a copy of the License at\n--\n--     http://www.apache.org/licenses/LICENSE-2.0\n--\n-- Unless required by applicable law or agreed to in writing, software\n-- distributed under the License is distributed on an \"AS IS\" BASIS,\n-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n-- See the License for the specific language governing permissions and\n-- limitations under the License.\n--\n\n\n{-# LANGUAGE OverloadedStrings   #-}\n{-# LANGUAGE ScopedTypeVariables #-}\nimport           Network.Minio\n\nimport           Data.Monoid           ((\u003c\u003e))\nimport           Data.Text             (pack)\nimport           Options.Applicative\nimport           System.FilePath.Posix\nimport           UnliftIO              (throwIO, try)\n\nimport           Prelude\n\n-- | The following example uses minio's play server at\n-- https://play.min.io.  The endpoint and associated\n-- credentials are provided via the libary constant,\n--\n-- \u003e minioPlayCI :: ConnectInfo\n--\n\n-- optparse-applicative package based command-line parsing.\nfileNameArgs :: Parser FilePath\nfileNameArgs = strArgument\n               (metavar \"FILENAME\"\n                \u003c\u003e help \"Name of file to upload to AWS S3 or a MinIO server\")\n\ncmdParser = info\n            (helper \u003c*\u003e fileNameArgs)\n            (fullDesc\n             \u003c\u003e progDesc \"FileUploader\"\n             \u003c\u003e header\n             \"FileUploader - a simple file-uploader program using minio-hs\")\n\nmain :: IO ()\nmain = do\n  let bucket = \"my-bucket\"\n\n  -- Parse command line argument\n  filepath \u003c- execParser cmdParser\n  let object = pack $ takeBaseName filepath\n\n  res \u003c- runMinio minioPlayCI $ do\n    -- Make a bucket; catch bucket already exists exception if thrown.\n    bErr \u003c- try $ makeBucket bucket Nothing\n\n    -- If the bucket already exists, we would get a specific\n    -- `ServiceErr` exception thrown.\n    case bErr of\n      Left BucketAlreadyOwnedByYou -\u003e return ()\n      Left e                       -\u003e throwIO e\n      Right _                      -\u003e return ()\n\n    -- Upload filepath to bucket; object name is derived from filepath.\n    fPutObject bucket object filepath defaultPutObjectOptions\n\n  case res of\n    Left e   -\u003e putStrLn $ \"file upload failed due to \" ++ show e\n    Right () -\u003e putStrLn \"file upload succeeded.\"\n```\n\n### Run FileUploader\n\n``` sh\n./FileUploader.hs \"path/to/my/file\"\n\n```\n\n## Contribute\n\n[Contributors Guide](https://github.com/minio/minio-hs/blob/master/CONTRIBUTING.md)\n\n### Development\n\n#### Download the source\n\n```sh\n$ git clone https://github.com/minio/minio-hs.git\n$ cd minio-hs/\n``` \n\n#### Build the package:\n\nWith `cabal`:\n\n```sh\n$ # Configure cabal for development enabling all optional flags defined by the package.\n$ cabal configure --enable-tests --test-show-details=direct -fexamples -fdev -flive-test\n$ cabal build\n```\n\nWith `stack`:\n\n``` sh\n$ stack build --test --no-run-tests --flag minio-hs:live-test --flag minio-hs:dev --flag minio-hs:examples\n```\n#### Running tests:\n\nA section of the tests use the remote MinIO Play server at `https://play.min.io` by default. For library development, using this remote server maybe slow. To run the tests against a locally running MinIO live server at `http://localhost:9000` with the credentials `access_key=minio` and `secret_key=minio123`, just set the environment `MINIO_LOCAL` to any value (and unset it to switch back to Play).\n\nWith `cabal`:\n\n```sh\n$ export MINIO_LOCAL=1 # to run live tests against local MinIO server\n$ cabal test\n```\n\nWith `stack`:\n\n``` sh\n$ export MINIO_LOCAL=1 # to run live tests against local MinIO server\nstack test --flag minio-hs:live-test --flag minio-hs:dev\n```\n\nThis will run all the test suites.\n\n#### Building documentation:\n\n```sh\n$ cabal haddock\n$ # OR\n$ stack haddock\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminio%2Fminio-hs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminio%2Fminio-hs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminio%2Fminio-hs/lists"}