Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gfournier/smart_pathlib
Utils for common path operations interoperability with Cloud storages
https://github.com/gfournier/smart_pathlib
azure-storage filesystem gcs s3
Last synced: about 2 months ago
JSON representation
Utils for common path operations interoperability with Cloud storages
- Host: GitHub
- URL: https://github.com/gfournier/smart_pathlib
- Owner: gfournier
- License: mit
- Created: 2021-01-13T22:00:35.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-13T10:34:41.000Z (almost 4 years ago)
- Last Synced: 2024-11-20T15:26:41.012Z (2 months ago)
- Topics: azure-storage, filesystem, gcs, s3
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smart_pathlib - making common path operations interoperable with Cloud object storages
![Test](https://github.com/gfournier/smart_pathlib/workflows/Test/badge.svg)
[![License:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![PyPI version fury.io](https://badge.fury.io/py/smart-pathlib.svg)](https://pypi.python.org/pypi/smart-pathlib/)## What ?
`smart_pathlib` is highly inspired by `smart_open` and provide drop-in
replacement for Python part of `os`, `os.path`, `glob` modules functions such as
`exists`, `stat`, `listdir`, `glob`.## Why ?
The goal is to provide a clean and Pythonic API for common file manipulations.
It simplifies rapid application development, making your code that manipulates
files interoperable with local file system and Cloud blob storage solutions
such as S3, GCS, Azure Blob Storage.## Example
A drop-in replacement `os.path.exists` that operates on different storage types:
```python
# Test if a local file exists
from smart_pathlib import exists
assert exists('/Users/me/Downloads/test_file.txt')
``````python
# Test if a file exists on GCS
from smart_pathlib import exists
assert exists('gs://my_bucket/test_file.txt')
```## Installation
You can select the "flavor" of `smart_pathlib` to install, depending on your
storage provider:```
pip install smart_pathlib[gcp] # Install GCP deps
```Or install all packages using:
```
pip install smart_pathlib[all]
```