ecmwfspec
This is work in progress! This unofficial repository aims to provide an fsspec driver for the ECMWF File Storage System.
Pull requests (also for additional protocols like MARS and FDB) are welcomed!
import fsspec
with fsspec.open("ec:/<user>/path/to/file", "r") as f:
print(f.read())
Loading datasets
import fsspec
import xarray as xr
url = fsspec.open("ec:/arch/project/file.grib").open()
ds = xr.open_dataset(url, engine='cfgrib') # does not work until https://github.com/ecmwf/cfgrib/issues/326 is solved
Usage in connection with gribscan
This is just an example what ecmwfspec can be used for.
import gribscan
import json
import xarray as xr
file_to_scan = "ec:///path/to/some/grib/file/forecast+0038.grib2"
index_file = "index.json"
reference_file = "reference.json"
gribscan.write_index(gribfile=file_to_scan, idxfile=index_file) # required currently patch https://github.com/gribscan/gribscan/commit/7a5e595759f48e3118964091358f1b2e9eb32b37 to work with fsspec paths
magician = gribscan.magician.HarmonieMagician() # use magician fitting the grib file
refs = gribscan.grib_magic(
filenames=[index_file],
magician=magician,
global_prefix="",
)
with open(reference_file, "w") as outfile:
json.dump(refs["heightAboveGround"], outfile)
ds = xr.open_zarr(f"reference::{reference_file}")
ds.u.max() # with the help of ecmwfspec the data is now fetched if it is not locally cached
Metadata
Release files for ecmwfspec 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ecmwfspec-0.0.7.tar.gz | 13.4 kB | Without provenance | Details for ecmwfspec-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ecmwfspec-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for ecmwfspec-0.0.7-py3-none-any.whl |
Total release size: 28.5 kB
Release files / ecmwfspec-0.0.7.tar.gz
| Download URL | ecmwfspec-0.0.7.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
109cd4316e1e84b012ecd11351647d8ec4a15c74dd3a84346d210b1d7422f294
|
|
BLAKE2b-256 checksum How to use checksums |
d17cc7530ef3bbeaa1db6b8d928273765cdfc3b809f7f26fb00a68e2a7c08a9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.26.9 CPython/3.14.4 Linux/6.17.0-1010-azure
|
Release files / ecmwfspec-0.0.7-py3-none-any.whl
| Download URL | ecmwfspec-0.0.7-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ce40010f0140c7833c1c0b6e73e9f91c702d1629204d9bbd4142b6b7c9ed490
|
|
BLAKE2b-256 checksum How to use checksums |
414178596f4f300e7b1aa7c3eccb348497d27eca97fe3f00f69398a04bde13bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.26.9 CPython/3.14.4 Linux/6.17.0-1010-azure
|
Security for ecmwfspec 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.