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 (requiresadlfsto be installed)http:andhttps:HTTP(S)-based filesystemhdfs:Hadoop distributed filesystemgs:andgcs:Google Cloud Storage (requiresgcsfsto be installed)s3:ands3a:AWS S3 (requiress3fsto 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file universal_pathlib-0.0.22.tar.gz.
File metadata
- Download URL: universal_pathlib-0.0.22.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb92756c68235f0feaff65bbfae1b5e27978ee68a41e8aca142b91c76adca242
|
|
| MD5 |
305baec0f999f898d226aa285a48ca33
|
|
| BLAKE2b-256 |
f46f994946afd0c4916c3cd0d7bc57f65dcdc06dd0f2b100197b067f9766cd59
|
File details
Details for the file universal_pathlib-0.0.22-py3-none-any.whl.
File metadata
- Download URL: universal_pathlib-0.0.22-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2772c36cd12b3051316b01ae190f75d679d2cb58796ee41b6662bf1f34b5fc30
|
|
| MD5 |
e7a8ab5a87c141a7778b3159ba998c6b
|
|
| BLAKE2b-256 |
edc7b9f714fe1017136fff4471842cdf8ec574406b856d49e6af696e5e086b6b
|