https://github.com/oscaro/tools-io-gs
Google storage support for tools-io
https://github.com/oscaro/tools-io-gs
clojure clojure-library google-cloud-storage
Last synced: 9 months ago
JSON representation
Google storage support for tools-io
- Host: GitHub
- URL: https://github.com/oscaro/tools-io-gs
- Owner: oscaro
- License: epl-1.0
- Created: 2019-05-16T12:25:00.000Z (over 6 years ago)
- Default Branch: devel
- Last Pushed: 2025-02-03T13:48:23.000Z (12 months ago)
- Last Synced: 2025-04-14T08:05:20.815Z (10 months ago)
- Topics: clojure, clojure-library, google-cloud-storage
- Language: Clojure
- Homepage: https://cljdoc.org/d/com.oscaro/tools-io-gs/0.1.5/doc/readme
- Size: 33.2 KB
- Stars: 3
- Watchers: 15
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tools-io-gs [API Docs](https://cljdoc.org/d/com.oscaro/tools-io-gs/0.1.6/doc/readme) [](https://cljdoc.org/d/com.oscaro/tools-io-gs/CURRENT)
Google Storage support for [`tools.io`](https://github.com/oscaro/tools-io).
## Usage
```clojure
[com.oscaro/tools-io-gs "0.1.17"]
```
### Example
```clojure
; read json
(doseq [x (read-jsons-file "gs://bucket/sample.jsons.gz")]
(println x))
; list files
(doseq [filename (list-files "gs://bucket/mydir/")]
(println filename))
; -> output:
; gs://bucket/mydir/example/raw-animals-aaaaaaaaaa.jsons.gz
; gs://bucket/mydir/example/raw-animals-aaaaaaaaab.jsons.gz
; gs://bucket/mydir/example/raw-animals-aaaaaaaaac.jsons.gz
; gs://bucket/mydir/example/raw-animals-aaaaaaaaad.jsons.gz
; gs://bucket/mydir/example/raw-animals-aaaaaaaaae.jsons.gz
; list files in a (virtual) directory
(doseq [filename (list-files "gs://bucket/mydir/" {:current-directory true})]
(println filename))
; list dirs
(->> (list-dirs "gs://bucket/dir")
count)
; -> output:
; gs://bucket/mydir/example/
; Get folder/file size
(sizeof "gs:/foo/bar") ;; => 8293
```
## License
Copyright © 2016-2025 Oscaro.com
Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.