Skip to main content

Date and time manipulation routines for the use of weather data

Project description

earthkit.time

:warning: This project is BETA and will be experimental for the foreseeable future. Interfaces and functionality are likely to change, and the project itself may be scrapped. DO NOT use this software in any project/software that is operational.

Date and time manipulation routines for the use of weather data

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

earthkit_time-0.1.2.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

earthkit_time-0.1.2-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file earthkit_time-0.1.2.tar.gz.

File metadata

  • Download URL: earthkit_time-0.1.2.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.8

File hashes

Hashes for earthkit_time-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c9d011c284a52dfe1effaac26c10e42ae56c6967d810f32c8340558ac914f5a5
MD5 2c8e21184c0c841b05652c920625ff9b
BLAKE2b-256 34c70919221587c54e75a323469364f5624a0842f40efaeb0046666d8e836c05

See more details on using hashes here.

File details

Details for the file earthkit_time-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for earthkit_time-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4fbdea009290641d7d77590900b3caa29f7190f532684a4569f6dcbce11a0089
MD5 74f72ac0cb45f14bba23678e8ea408fb
BLAKE2b-256 9e8d574815a12c3a95a5d7f67c87b6d57ad9d507a2551d52190520fbd53db2c2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page