Protocol Support
Overview
aiomegfile exposes a unified async API over several path protocols. In most
cases you can switch between local and remote paths without changing the higher
level calling code.
Supported Backends
Protocol |
Path format |
Availability |
Notes |
|---|---|---|---|
Local filesystem |
|
Built in |
Full read, write, scan, stat, and path operations. |
Amazon S3 |
|
Built in |
Async object access backed by |
HTTP / HTTPS |
|
Built in |
Read-oriented access for streaming and metadata inspection. |
SFTP |
|
Built in |
Remote filesystem access backed by |
stdio |
|
Built in |
Bridge stdin, stdout, and stderr through the same async API. |
HDFS |
|
Optional |
Install |
WebDAV / WebDAVS |
|
Optional |
Install |
Path Semantics
Plain paths without a protocol are treated as local filesystem paths.
SmartPathpreserves the protocol, soSmartPath("s3://bucket/key")andSmartPath("/tmp/file")work through the same abstraction.Utility functions such as
smart_open(),smart_copy(), andsmart_sync()dispatch to the correct backend automatically.
Alias Support
Aliases are loaded from ~/.config/megfile/megfile.conf. They let you define
short protocol prefixes for repeated locations.
Example:
[alias]
datasets = s3://company-datasets/
web = https://static.example.com/
After that, these URIs become valid inputs:
datasets://images/train-0001.jpg
web://releases/latest.json