cloud-file
Simple reading of cloud files in Rust
Highlights
- HTTP, AWS S3, Azure, Google, or local
- Sequential or random access
- Simplifies use of the powerful
object_store
crate, focusing on a useful subset of its features - Access files via URLs and string-based options
- Read binary or text
- Fully async
- Used by genomics crate BedReader, which is used by other Rust and Python projects
- Also see Nine Rules for Accessing Cloud Files from Your Rust Code Practical Lessons from Upgrading Bed-Reader, a Bioinformatics Library in Towards Data Science.
Install
Examples
Find the size of a cloud file.
use CloudFile;
# new.unwrap.block_on.unwrap;
# use ;
Find the number of lines in a cloud file.
use CloudFile;
use StreamExt; // Enables `.next()` on streams.
# new.unwrap.block_on.unwrap;
# use ;
More examples
Example | Demonstrates |
---|---|
line_count |
Read a file as binary chunks. |
nth_line |
Read a file as text lines. |
bigram_counts |
Read random regions of a file, without regard to order. |
aws_file_size |
Find the size of a file on AWS. |