Date and time manipulation routines for the use of weather data
Project description
earthkit.time
:warning: This project is in the BETA stage of development. Please be aware that interfaces and functionality may change as the project develops. If this software is to be used in operational systems you are strongly advised to use a released tag in your system configuration, and you should be willing to accept incoming changes and bug fixes that require adaptations on your part. ECMWF does use this software in operations and abides by the same caveats.
Date and time manipulation routines for the use of weather data
Documentation
The documentation can be found at https://earthkit-time.readthedocs.io.
Python API
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
License
Apache License 2.0 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
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
File details
Details for the file earthkit_time-0.1.4.tar.gz
.
File metadata
- Download URL: earthkit_time-0.1.4.tar.gz
- Upload date:
- Size: 30.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f7f9fb5e4a9a55e65d0f58bca93e306d990f79efecaea17c0c86a03b73a3393 |
|
MD5 | 60a905d3ff103e3574000257f6492236 |
|
BLAKE2b-256 | 7adf3fcff5dab1cee2d32eeaf5ac57af2fee412accb3fe03b1f24457c2f19296 |
File details
Details for the file earthkit_time-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: earthkit_time-0.1.4-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56feb4844ef1a47df75522754e602fb9e12ea03992f378023e8fd119f7d2c86d |
|
MD5 | edf0158f798519bc4ca9b5eb1f555d16 |
|
BLAKE2b-256 | 7574e6ecd2795016b3364dd106511fc48d519891f42dd0c9937eeda6eaf7019c |