Metadata-Version: 2.1
Name: minato
Version: 0.8.0
Summary: Cache and file system for online resources
Home-page: https://github.com/altescy/minato
License: MIT
Keywords: python,cache,s3,google-cloud-storage
Author: Yasuhiro Yamaguchi
Author-email: altescy@fastmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: all
Provides-Extra: gcs
Provides-Extra: s3
Requires-Dist: boto3 (>=1.17.97,<2.0.0); extra == "s3" or extra == "all"
Requires-Dist: google-cloud-storage (>=1.39.0,<2.0.0); extra == "gcs" or extra == "all"
Requires-Dist: requests (>=2.25.1,<3.0.0)
Requires-Dist: tqdm (>=4.60.0,<5.0.0)
Description-Content-Type: text/markdown

Minato
======

[![Actions Status](https://github.com/altescy/minato/workflows/CI/badge.svg)](https://github.com/altescy/minato/actions/workflows/main.yml)
[![Python version](https://img.shields.io/pypi/pyversions/minato)](https://github.com/altescy/minato)
[![License](https://img.shields.io/github/license/altescy/minato)](https://github.com/altescy/minato/blob/master/LICENSE)
[![pypi version](https://img.shields.io/pypi/v/minato)](https://pypi.org/project/minato/)

Cache & file system for online resources in Python


## Features

Minato enables you to:
- Download & cache online recsources
  - minato supports the following protocols: HTTP(S) / AWS S3 / Google Cloud Storage
  - You can manage cached files via command line interface
- Automatically update cached files based on ETag
  - minato downloads new versions if available when you access cached files
- Open online files super easily
  - By using `minato.open`, you can read/write online resources like the built-in `open` method

## Installation

```
pip install minato[all]
```

## Usage

### Python

```python
import minato

# Read / write files on online storage
with minato.open("s3://your_bucket/path/to/file", "w") as f:
    f.write("Create a new file on AWS S3!")

# Cache & manage online resources in local storage
local_filename = minato.cached_path("http://example.com/path/to/archive.zip!inner/path/to/file")
```

### CLI

```
❯ poetry run minato --help
usage: minato

positional arguments:
  {cache,list,remove,update}
    cache               cache remote file and return cached local file path
    list                show list of cached files
    remove              remove cached files
    update              update cached files

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
```

