kadi-fsspec
Expose a kadi4mat collection as fsspec filesystem. Collections and records are represented as directories. Files attached to records are represented as files.
The kadi-apy library is used, in particular all API calls go through a KadiManager instance.
Usage
General
Basic usage, assuming you have a .kadiconfig file (e.g. because you have previously used kadi-apy):
from kadi_fsspec import KadiFileSystem
root_collection_identifier = "@root-collection"
fs = KadiFileSystem(root_collection_identifier)
Alternatively, pass an instance of KadiManager or options to create one, for example:
from kadi_fsspec import KadiFileSystem
from kadi_apy import KadiManager
root_collection_identifier = "@root-collection"
manager = KadiManager(
host="https://kadi4mat.iam.kit.edu/",
pat="<your-kadi-access-token>",
)
fs = KadiFileSystem(root_collection_identifier, kadi_manager=manager)
Inside marimo
The original motivation for this package was to allow users of marimo to browse a kadi4mat collection from inside a notebook.
If you add a cell with the code shown above, marimo should autodetect the instance of fsspec.AbstractFileSystem and a file tree should appear in the "Remote Storage" section of the "Files" tab of the left sidebar.
Other usage
The package registers the kadi:// protocol in fsspec, so you can also get an instance of a KadiFileSystem filesystem or open a file via the fsspec API:
# Instance of KadiFileSystem
fs = fsspec.filesystem("kadi", root_collection_identifier="@root-collection")
# Open files directly
with fsspec.open("kadi:///some-collection/some-record/some-file.txt", "rb", root_collection_identifier="@root-collection") as f:
print(f.read().decode())
Status
- Listing records and collections as directories
- Read and download files
- Create new records (parent collection must exist)
- Write to existing files
- Create new files (parent record must exist)
- Partial reads, streaming
License and Copyright
Copyright GFZ Helmholtz Centre for Geosciences. kadi-fsspec is licensed under EUPL-1.2.
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 kadi_fsspec-0.1.0.tar.gz.
File metadata
- Download URL: kadi_fsspec-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51a2e891a2696992b48d0fd5ae585750705c3e1a8e96ae1e842ad83660fa5664
|
|
| MD5 |
1fd68dfb47b71e3a7bcf78783e31bdcc
|
|
| BLAKE2b-256 |
67feb841ecefb19c453fc4b9d84ac6711bd27716484299df9a829db4058d98a2
|
File details
Details for the file kadi_fsspec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kadi_fsspec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56b0ad3b5814aa2b7a12ef742eed5ad72851e426037021974c08b830fb966413
|
|
| MD5 |
1f1ca889a8253ab4973cc27d1e63701c
|
|
| BLAKE2b-256 |
e186c642230c22bd13ad96bc001fe81c6c6ab1764ca5e703e304ae594a4c7243
|