{"id":23284205,"url":"https://github.com/agilecreativity/data-fetcher","last_synced_at":"2025-04-06T15:15:15.283Z","repository":{"id":57713596,"uuid":"139931039","full_name":"agilecreativity/data-fetcher","owner":"agilecreativity","description":"Copy remote data locally with Clojure","archived":false,"fork":false,"pushed_at":"2018-07-09T04:12:03.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T05:01:56.864Z","etag":null,"topics":["clojure-library","utility-library"],"latest_commit_sha":null,"homepage":"https://github.com/agilecreativity/data-fetcher","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agilecreativity.png","metadata":{"files":{"readme":"README.org","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-06T03:57:05.000Z","updated_at":"2018-07-09T04:12:05.000Z","dependencies_parsed_at":"2022-09-02T12:11:43.189Z","dependency_job_id":null,"html_url":"https://github.com/agilecreativity/data-fetcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fdata-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fdata-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fdata-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fdata-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilecreativity","download_url":"https://codeload.github.com/agilecreativity/data-fetcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500476,"owners_count":20948880,"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":["clojure-library","utility-library"],"created_at":"2024-12-20T01:38:38.721Z","updated_at":"2025-04-06T15:15:15.260Z","avatar_url":"https://github.com/agilecreativity.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"** data-fetcher\n\n[[https://clojars.org/data-fetcher][https://img.shields.io/clojars/v/data-fetcher.svg]]\n[[https://jarkeeper.com/agilecreativity/data-fetcher][https://jarkeeper.com/agilecreativity/data-fetcher/status.svg]]\n\nSimple library to automate download of resource files using Clojure.\nIntended to be used by Clojure binding of [[https://github.com/apache/incubator-mxnet/tree/master/contrib/clojure-package][Apache MXNet]]\n\n*** API Provided\n\n| function             | Description                                                  |\n|----------------------+--------------------------------------------------------------|\n| download-file        | download file from a given url                               |\n| download-and-extract | download file from a given url and checking for file locally |\n\n*** Basic Usage\n\nInstead of writing this in shell script\n\n#+BEGIN_SRC sh\nset -evx\nmkdir -p data/mr-data\ncd data/mr-data\nwget https://raw.githubusercontent.com/yoonkim/CNN_sentence/master/rt-polarity.neg\nwget https://raw.githubusercontent.com/yoonkim/CNN_sentence/master/rt-polarity.pos\ncd ../..\n\nmkdir -p data/glove\ncd data/glove\nwget http://nlp.stanford.edu/data/glove.6B.zip\nunzip *.zip\ncd ../..\n#+END_SRC\n\nWe should be able to get the same result using simple Clojure function.\n\n#+BEGIN_SRC clojure\n  (require '[data-fetcher.core :refer [download-and-extract]])\n\n  ;; Download multiple files\n  (doseq [file (seq [\"rt-polarity.neg\" \"rt-polarity.pos\"])]\n    (let [output-dir \"data/mr-data\"\n          url (format \"https://raw.githubusercontent.com/yoonkim/CNN_sentence/master/%s\" file)]\n      (download-and-extract url output-dir file)))\n\n  ;; Download a single file and check for content of the file, skip if we have already download once!\n  (let [url \"http://nlp.stanford.edu/data/glove.6B.zip\"\n        output-dir \"data/glove\"\n        sample-file \"glove.6B.300d.txt\"]\n    (download-and-extract url output-dir sample-file))\n#+END_SRC\n\n*** TODOs\n\n**** TODO: add more tests\n\n*** License\n\nCopyright © 2018 Burin Choomnuan\n\nDistributed under the Eclipse Public License either version 1.0 or (at your option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Fdata-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilecreativity%2Fdata-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Fdata-fetcher/lists"}