semvec/pypi-packages huggingface dataset:
s3-streaming 0.0.3
stream and (de)serialize s3 objects with no local footprint

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# s3-streaming: handling (big) S3 files like regular files
Storing, retrieving and using files in S3 is a regular activity so it should be easy. It should also ...
* stream the data
* have an api that is python file-io like
* handle some of the desearization and compression stuff because why not

## Install

```bash
pip install s3-streaming
```

## Streaming S3 objects like regular files

### The basics
Opening and reading S3 objects is similar to regular python io. The only difference is that you need to provide a 
`boto3.session.Session` instance to handle the bucket access. 

```python
import boto3
from s3streaming import s3_open


with s3_open('s3://bucket/key', boto_session=boto3.session.Session()) as f:
    for next_line in f:
        print(next_line)
```

### Injecting deserialization and compression handling in stream
Consider a file that is `gzip` compressed and contains lines of `json`. There's some boilerplate in dealing with that,
but why bother? Just handle that in stream.

```python
from s3streaming import s3_open, deserialize, compression


reader_settings = dict(
  boto_session=boto3.session.Session(),
  deserializer=deserialize.json_lines, 
  compression=compression.gzip
)

with s3_open('s3://bucket/key.gzip', **reader_settings) as f:
    for next_line in f:
        print(next_line.keys())    # because the file was decompressed ...
        print(next_line.values())  #   ... and the json is now a loaded dict!

```

Other `deserialize` options include 
* `csv`
* `csv_as_dict`
* `tsv`
* `tsv_as_dict`
* `string`
sdsheets 1.0.3
Lib para recuperar informações de planilhas do Google Spreadsheets
Requires Python: >=3.6


# Objetivo
Lib para recuperar informações de planilhas do Google Spreadsheets através de API

# Utilização

1. Habilitar a API do Google Spreadsheets no console do GCP > APIs & Services > Libraries > Google Sheets API > Enable

2. Criar uma key no console do GCP para autenticação na API através de IAM & Admin > Service Accounts > Create Key
   2.1. Baixar o arquivo no formato JSON e armazenar em uma das pastas do projeto

3. Instanciar a classe Sheets, informando 2 parâmetros:

   keyPath: Caminho e nome do arquivo que contém a chave de acesso para a API do Google Sheets
   Exemplo: 'credentials/project-0456d0f0cd6a.json'

   spreadsheetId: Id da planilha que será consultada
   Exemplo: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms'

4. Executar o método getRangeData, passando como parâmetro o range de células que deseja recuperar.

   Exemplo: `res = getRangeData('Class Data!A2:E')`

## Requisitos

Instalar as libs abaixo:

`pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib`
`pip install oauth2client`

## Manutenção

Após executar o clone deste código, executar o comando abaixo, para baixar todas as dependências:

`make install`