This library allows you to retrieve BytesIO objects from various sources asynchronously. Whether you're dealing with cloud storage, HTTP endpoints, FTP servers, or local files.
Project description
๐ aiodoc: Async ByteIO Retrieval from Any Source ๐ชฃ
Welcome to aiodoc! ๐ This library allows you to retrieve BytesIO
objects from various sources asynchronously. Whether you're dealing with cloud storage, HTTP endpoints, FTP servers, or local files, aiodoc
has got you covered! ๐
๐ฏ Key Features
- Async all the way ๐: Perform all file operations asynchronously to keep your application responsive.
- Retrieve from any source ๐: Supports AWS S3, MinIO, Google Cloud Storage, HTTP, FTP, Redis, Memcached, and even local file systems.
- Unified API ๐คน: A simple, easy-to-use interface for interacting with any storage system.
๐ผ Supported Providers
- ๐ AWS S3 via
aiobotocore
๐ - ๐ฆ MinIO using
minio-py
๐ ๏ธ - โ๏ธ Google Cloud Storage with
google-cloud-storage
๐ฉ - ๐ HTTP with
httpx
๐ - ๐ Local file system with
aiofile
๐๏ธ - ๐ง Memcached using
aiomemcached
๐งณ - ๐ฅ Redis via
aioredis
๐ฅ - ๐ FTP with
aioftp
๐ก
๐ How to Install
-
Clone the repo:
git clone https://github.com/your-repo/aiodoc.git
-
Install dependencies:
pip install -r requirements.txt
-
Done! ๐ Now you're ready to use
aiodoc
for all your asynchronous file needs.
๐ ๏ธ Usage
๐ฉ Create Your Provider
You can set up and use different providers based on your needs.
๐ AWS S3 Example
from aiobotocore.session import AioSession
from aiodoc import S3Provider
# Initialize S3 provider
session = AioSession()
s3_provider = S3Provider(session)
# Retrieve a file as a BytesIO object
file_bytes = await s3_provider.download("my-bucket", "my-file.txt")
โ๏ธ Google Cloud Storage Example
from google.cloud import storage
from aiodoc import GCPProvider
# Initialize GCP provider
client = storage.Client()
gcp_provider = GCPProvider(client)
# Retrieve a file as a BytesIO object
file_bytes = await gcp_provider.download("my-bucket", "my-file.txt")
๐ Local File System Example
from aiodoc import FileProvider
# Initialize File provider
file_provider = FileProvider()
# Retrieve a file as a BytesIO object
file_bytes = await file_provider.download("bucket", "/path/to/file.txt")
๐ฅ Redis Example
from aioredis import Redis
from aiodoc import RedisProvider
# Initialize Redis provider
redis_client = await Redis.create()
redis_provider = RedisProvider(redis_client)
# Retrieve a file as a BytesIO object
file_bytes = await redis_provider.download("bucket", "file-key")
๐ ๏ธ Available Operations
- Upload ๐: Upload a
BytesIO
object to any provider. - Download โฌ๏ธ: Retrieve a
BytesIO
object from any provider. - List Files ๐: List files (where supported).
- Delete File โ: Delete a file (where supported).
๐ค Contributing
Feel free to submit issues or pull requests if you'd like to contribute!
๐ License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiodoc-0.1.0.tar.gz
.
File metadata
- Download URL: aiodoc-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90ce3e6f8d71be1b8504c5aa2974647cc453c7fbf81894eb4ed5635737460c3f |
|
MD5 | ad1418aa0c185c6387e42a268050c192 |
|
BLAKE2b-256 | 3e27622e78fad5555b8a72419b8e7b4f68e988c0a7e8b0dbe2d80bbbaaac0b98 |
File details
Details for the file aiodoc-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiodoc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd288b070bd0a79596ea835a952081a5715cec18aea4579106067893834b754 |
|
MD5 | 4e9ba69bc111eb968ce09f7ce08df129 |
|
BLAKE2b-256 | ce37ee1ba63634001fc1f74bc9b453429fae0372b4f46a55ab874d114f0dfc50 |