Opens files for reading.

Overview

smart-open

Opens files for reading.

What??

smart_open is a rust crate under active development with the goal of opening any text file (compressed or uncompressed) present either in local or on the cloud or the web.

extern crate smart_open as sm;

pub fn main() {
    let text = sm::smart_open("tests/bar.txt.gz").unwrap();
    println!("{}", text);
}

You can find sample code for other types of files in the examples directory.

Goals for this project

  • Open text file on local filesystem.
  • Open gz text file on local filesystem.
  • Support for other text file formats (csv, json) etc.
  • s3 text files.
  • s3 + gz files.
  • http text files.
  • http + gz files

Comments, bug reports

smart_open lives on Github. You can file issues or pull requests there. Suggestions, pull requests and improvements welcome!

smart_open is open source software released under the MIT license. Copyright (c) 2018-now Joydeep Bhattacharjee.

You might also like...
Pure rust library for reading / writing DNG files providing access to the raw data in a zero-copy friendly way.

DNG-rs   A pure rust library for reading / writing DNG files providing access to the raw data in a zero-copy friendly way. Also containing code for re

Code sample for "Reading files the hard way Part 3"

read-raw-ext4 Rust code sample to read an ext4 partition from Rust, for: https://fasterthanli.me/series/reading-files-the-hard-way/part-3 Usage Don't.

Tar file reading/writing for Rust

tar-rs Documentation A tar archive reading/writing library for Rust. # Cargo.toml [dependencies] tar = "0.4" Reading an archive extern crate tar; use

Rust library for reading/writing numbers in big-endian and little-endian.

byteorder This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order. Dual-licensed under M

:crab: Small exercises to get you used to reading and writing Rust code!
:crab: Small exercises to get you used to reading and writing Rust code!

rustlings 🦀 ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

CLI for reading IETF RFCs

██▄██ ▄▄█▄ ▄█ ▄▄ ██ ▄█ ▄▄██ ██ ▄█ █▄▄▄█▄▄▄██▄██▄██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ietf 0.2.1 CLI for reading IETF RFCs. USAGE: ietf [OPTIONS] [SUBCOMMAND] FL

Zero-Copy reading and writing of geospatial data.

GeoZero Zero-Copy reading and writing of geospatial data. GeoZero defines an API for reading geospatial data formats without an intermediate represent

Reading GeoTIFFs in Rust, nothing else!

A TIFF Library for Rust I needed this library to import elevation models for a routing library. As elevation models usually come in GeoTIFF format, bu

A simple news reading GUI app built in Rust
A simple news reading GUI app built in Rust

Headlines [WIP] A native GUI app built with Rust using egui. Uses newsapi.org as the source to fetch news articles. This is a WIP and the current stat

An application for reading comics together.

Shared comic reader Creates a web server that serves image sets to one or more clients. When one of those clients turns a page, all other clients who

Cross-platform library for reading/writing memory in other processes for Rust

vmemory Rust library for reading/writing memory in other processes for Windows, macOS, Linux, and in the future potentially, BSD variants. Rationale A

A rust library that makes reading and writing memory of the Dolphin emulator easier.

dolphin-memory-rs A crate for reading from and writing to the emulated memory of Dolphin in rust. A lot of internals here are directly based on aldela

Rust crate `needleman_wunsch` of the `fasebare` package: reading FASTA sequences, Needleman-Wunsch alignment

fasebare Rust crate needleman_wunsch of the fasebare package: reading FASTA sequences, Needleman-Wunsch alignment. Synopsis The crate needleman_wunsch

Easy reading and writing of `serde` structs to/from Google Sheets

serde_sheets Read and write structs directly from google sheets using serde and csv Implement serde::Serialize to write and serde::Deserialize to read

This library provides a data view for reading and writing data in a byte array.

Docs This library provides a data view for reading and writing data in a byte array. This library requires feature(generic_const_exprs) to be enabled.

This project contains small exercises to get you used to reading and writing Rust code
This project contains small exercises to get you used to reading and writing Rust code

rustlings 🦀 ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

A simple MD5 implementation with a focus on buffered reading

md5-rs A simple MD5 implementation with a focus on buffered reading, and is completely no_std. This shouldn't be used in any security-critical softwar

An open source, programmed in rust, privacy focused tool for reading programming resources (like stackoverflow) fast, efficient and asynchronous from the terminal.

Falion An open source, programmed in rust, privacy focused tool for reading programming resources (like StackOverFlow) fast, efficient and asynchronou

📚 flow state reading in the terminal
📚 flow state reading in the terminal

fsrx 📚 (f)low (s)tate (r)eading e(x)change – flow state reading in the terminal Inspired by (but not affiliated with) Renato Casutt and his revolutio

Comments
  • Mock all the external dependencies

    Mock all the external dependencies

    This is really pestering me right now is that I cannot effectively mock all my dependencies such as reqwest. I have right now found some solutions such as

    • https://github.com/cyplo/rust-dependency-injection/blob/master/src/main.rs
    • https://github.com/nathanielsimard/mock-it
    opened by infinite-Joy 0
Owner
Joydeep Bhattacharjee
Machine Learning Engineer
Joydeep Bhattacharjee
Tar file reading/writing for Rust

tar-rs Documentation A tar archive reading/writing library for Rust. # Cargo.toml [dependencies] tar = "0.4" Reading an archive extern crate tar; use

Alex Crichton 490 Dec 30, 2022
A Rust application that compress files and folders

Quick Storer This is a Rust application that compress files and folders. Usage Download or build the binary and place it on your desktop, or any other

AL68 & co. 1 Feb 2, 2022
A library to create zip files on a non-seekable writer

A library to create zip files on a non-seekable writer

nyantec GmbH 2 Mar 17, 2022
Obvious Unified Compression Helper is a CLI tool to help you compress and decompress files of several formats

Ouch! ouch stands for Obvious Unified Compression Helper and is a CLI tool to help you compress and decompress files of several formats. Features Usag

null 734 Dec 30, 2022
📦 Unpack deep archive files recursively over a file tree or a folder

deep-unpack Unpack deep archive files recursively over a file tree or a folder. Usage [dependencies] deep-unpack = { version = "0.1.2" } Usage fn main

null 3 Dec 4, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Rust crate for reading SER files used in astrophotography

Rust crate for reading SER files used in astrophotography.

Andy Grove 2 Oct 4, 2021
Convenience library for reading and writing compressed files/streams

compress_io Convenience library for reading and writing compressed files/streams The aim of compress_io is to make it simple for an application to sup

Simon Heath 0 Dec 16, 2021
ezio offers an easy to use IO API for reading and writing to files and stdio

ezio - a crate for easy IO ezio offers an easy to use IO API for reading and writing to files and stdio. ezio includes utilities for generating random

Nick Cameron 98 Dec 21, 2022
A Rust library for reading asset files and resource packs for any version of Minecraft

minecraft-assets A Rust library for reading asset files and resource packs for any version of Minecraft. Example use minecraft_assets::api::AssetPack;

Ben Reeves 7 Aug 14, 2022