Pathlib API extended to use fsspec backends
Project description
Universal Pathlib
Universal Pathlib is a python library that aims to extend Python's built-in pathlib.Path
api to use a variety of backend filesystems using fsspec
Installation
Pypi
pip install universal_pathlib
conda
conda install -c conda-forge universal_pathlib
Basic Usage
>>> from upath import UPath
>>> import s3fs
>>> s3path = UPath("s3://test_bucket") / "example.txt"
>>> s3path.name
example.txt
>>> s3path.stem
example
>>> s3path.suffix
.txt
>>> s3path.exists()
True
>>> s3path.read_text()
'Hello World'
For more examples, see the example notebook here
Currently supported filesystems (and schemes)
file:
Local filessystemmemory:
Ephemeral filesystem in RAMaz:
,adl:
andabfs:
Azure Storage (requiresadlfs
to be installed)http:
andhttps:
HTTP(S)-based filesystemhdfs:
Hadoop distributed filesystemgs:
andgcs:
Google Cloud Storage (requiresgcsfs
to be installed)s3:
ands3a:
AWS S3 (requiress3fs
to be installed)webdav+http:
andwebdav+https:
WebDAV-based filesystem on top of HTTP(S) (requireswebdav4[fsspec]
to be installed)
Other fsspec-compatible filesystems may also work, but are not supported and tested. Contributions for new filesystems are welcome!
License
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
universal_pathlib-0.0.19.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for universal_pathlib-0.0.19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72df949935a12b7e6614481bb406df82383db52c58acba1bb44246762c76b127 |
|
MD5 | 55ccc08a0e2b287c26b24022e674bc2b |
|
BLAKE2b-256 | 65cea21e694f2be2c03f632e46447d7ad7e316c2989938fc54ac65cc1f1638f0 |