/leapseconds

A Python library with data for official leap seconds, provided as a tuple of Unix timestamps

Primary LanguagePythonMIT LicenseMIT

leapseconds

PyPi Version License Continuous Integration Code Coverage Python Versions


leapseconds is a Python library with data on official leap seconds, provided as a tuple of Unix timestamps.

Source data: https://www.ietf.org/timezones/data/leap-seconds.list

Installation

pip install leapseconds

Usage

from leapseconds import LEAP_SECONDS

# Check if a Unix timestamp represents an officially announced leap second:
if 63072000 in LEAP_SECONDS:
    print("True")
  • LEAP_SECONDS:
    • A tuple of Unix timestamps (int) that represent officially announced leap seconds in chronological order.

License

leapseconds is distributed under the terms of the MIT license.