Date and time manipulation routines for the use of weather data
Project description
Quick Start • Installation • Documentation
[!IMPORTANT] This software is Emerging and subject to ECMWF's guidelines on Software Maturity.
earthkit-time is a package containing date and time manipulation routines for the use of weather data. It is a component of earthkit.
Documentation
The documentation can be found at https://earthkit-time.readthedocs.io.
Installation
Install from PyPI:
pip install earthkit-time
Quick Start
When is the next Tuesday?
import datetime
from earthkit.time import WeeklySequence
from earthkit.time.calendar import TUESDAY
sequence = WeeklySequence(TUESDAY)
next_tue = sequence.next(datetime.date.today())
print(f"Next Tuesday: {next_tue:%Y%m%d}")
Pre-defined sequences
import datetime
from earthkit.time import Sequence
sequence = Sequence.from_resource("ecmwf-4days")
dates = sequence.range(datetime.date(2024, 2, 1), datetime.date(2024, 3, 1), include_end=False)
print("February dates:", ", ".join(date.strftime("%Y%m%d") for date in dates))
Model climate dates
import datetime
from earthkit.time import Sequence, model_climate_dates
sequence = Sequence.from_resource("ecmwf-2days")
dates = model_climate_dates(datetime.date(2024, 2, 12), 2020, 2023, 7, 7, sequence)
print("Model climate dates:", ", ".join(date.strftime("%Y%m%d") for date in dates))
Command-line interface
Give me the two previous prime-numbered days and the next
earthkit-dateseq bracket --monthly 2/3/5/7/11/13/17/19/23/29/31 20240510 2 1
Model climate dates
earthkit-climdates mclim --from-year 2015 --to-year 2020 --before 7 --after 7 --preset ecmwf-mon-thu 20230806
Licence
Copyright 2024, European Centre for Medium Range Weather Forecasts.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
In applying this licence, ECMWF does not waive the privileges and immunities
granted to it by virtue of its status as an intergovernmental organisation
nor does it submit to any jurisdiction.
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 earthkit_time-0.1.8.tar.gz.
File metadata
- Download URL: earthkit_time-0.1.8.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d211f1647c169b34cf79177aed17ac4f472cb8bd3096f98b08d7f77293dfcd81
|
|
| MD5 |
d18506012055f314db39625fba3912c8
|
|
| BLAKE2b-256 |
49fa37a9a90303908685fba892402248789de689071f6ad4c1373dfd195ac34e
|
File details
Details for the file earthkit_time-0.1.8-py3-none-any.whl.
File metadata
- Download URL: earthkit_time-0.1.8-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a09de208a3696f497e2d9495e535a9e2fc805f0148d4e2555abefd0da759216d
|
|
| MD5 |
fdd11b3892c547c49ab0a91d54d2e1b0
|
|
| BLAKE2b-256 |
4096614cc95e2bd7f2075b8b4f4b85b37df655c3cc3028f949b799224f4546d4
|