Metadata-Version: 2.4
Name: skyio
Version: 1.0.0
Summary: This library provides a simple interface to interact with Google Cloud Storage and other cloud storage services.
Requires-Python: >=3.10
Requires-Dist: colorama>=0.4.6
Requires-Dist: gcsfs>=2024.9.0.post1
Requires-Dist: google-cloud-storage>=2.18.2
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: rich>=13.8.1
Requires-Dist: tqdm>=4.66.5
Description-Content-Type: text/markdown


# cloudfspy


`cloudfspy` is a Python library that offers a `pathlib`-style interface for interacting with various cloud storage services, including Amazon S3, Azure Blob Storage, and Google Cloud Storage. It provides a simple and consistent API, modeled after the `Path` class from the `pathlib` module, enabling seamless access and manipulation of files and folder in cloud storage. Currently, `cloudfspy` supports the following cloud storage services:

- [x] Google Cloud Storage (GCS)
- [ ] Amazon S3
- [ ] Azure Blob Storage
- [ ] Dropbox
- [ ] OneDrive
- [ ] FTP/SFTP

## Installation

```bash
pip install cloudfspy
```

## Usage

cloudfspy uses a `GenericPath` class that is a subclass of `pathlib.Path`. This class provides a consistent interface for accessing files on cloud storage services.

### Downloading and Uploading Files

```python
from cloudfspy import GenericPath as Path

# Download a file from GCS to a local file
from_path = Path("gs://my-bucket/my-file.txt")
to_path = Path("/path/to/my-file.txt")
from_path.download_to(to_path)

# Upload a local file to GCS
from_path = Path("/path/to/my-file.txt")
to_path = Path("gs://my-bucket/my-file.txt")
from_path.upload_to(to_path)
```

### Working with Directories

```python
from cloudfspy import GenericPath as Path

# Create a directory on GCS
cloud_dir = Path("gs://my-bucket/my-directory")
cloud_dir.mkdir(exist_ok=True, parents=True)

# Iterate over the files in a directory
for file in cloud_dir.iterdir():
    print(file)

# Remove a directory
cloud_dir.rmdir()
```

### Metadata

```python
from cloudfspy import GenericPath as Path

# Get the metadata of a file
cloud_file = Path("gs://my-bucket/my-file.txt")
metadata = cloud_file.metadata

# Set the metadata of a file
cloud_file.metadata = {"description": "My file"}
