Skip to main content

Project Logo

The Lupaxa Developers Toolbox
Part of The Lupaxa Project


lupaxa-expired

Tiny utility to check whether a timestamp has expired relative to UTC now. A value is expired when it is strictly earlier than (now - delta). With no window, delta is zero: anything before UTC now is expired, and a time equal to now is not.

Built for scripts and tools used by The Lupaxa Project.

The PyPI name is lupaxa-expired. The import path is lupaxa.expired. The CLI is installed as expired.

Features

  • Accepts ISO, SQL, and date-only timestamp strings, or a datetime
  • Optional window via timedelta or parts: years, months, weeks, days, hours, minutes, seconds
  • Timezone-aware UTC comparison (naive values treated as UTC)
  • Library API returns a boolean; equal-to-cutoff is not expired
  • CLI with --version, stdout expired / not expired, and shell exit codes
  • Fully typed, linted, formatted, and tested
  • No runtime dependencies

Installation

From PyPI

pip install lupaxa-expired

From source (development mode)

pip install -e ".[dev]"

Requires Python 3.10+. lupaxa is a namespace package — there is no lupaxa/__init__.py.

Usage

from datetime import datetime, timedelta, timezone
from lupaxa.expired import is_expired

if is_expired("2022-10-19 14:43:57.563803"):
    print("Expired")

cutoff = datetime(2025, 11, 6, 12, 0, 0, tzinfo=timezone.utc)
is_expired("2025-10-01", days=3, now=cutoff)
is_expired(cutoff - timedelta(hours=72), hours=48, now=cutoff)
is_expired("2025/11/01 14:43:57", fmt="%Y/%m/%d %H:%M:%S", days=2, now=cutoff)

Built-in string formats include YYYY-MM-DD, YYYY-MM-DD HH:MM:SS[.ffffff], and ISO-8601 with an optional Z. Pass fmt= for anything else. Years are 365 days and months are 30 days.

expired --time "2022-10-19 14:43:57.563803"
expired --time "2022-10-19 14:43:57.563803" --days 3
expired --time "2024-11-06T09:00:00Z" --hours 12
expired --time "2024/11/06 09:00:00" --format "%Y/%m/%d %H:%M:%S" --days 1
expired --version
expired --help

The CLI prints expired or not expired. Exit 0 means not expired (or --version), 1 means expired, and 2 means bad input.

Delta flags: --years, --months, --weeks, --days, --hours, --minutes, --seconds.

Development

make init
make python-install-dev
make python-check
make mkdocs-serve

Documentation: https://expired.thelupaxaproject.org/.

The Lupaxa Project Footer

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lupaxa_expired-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lupaxa_expired-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file lupaxa_expired-0.1.0.tar.gz.

File metadata

  • Download URL: lupaxa_expired-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lupaxa_expired-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3a126c0800ab6cfb5e223c16f75c22731e874422393a802129dbeb4275702916
MD5 d19a769e180c862f67c67d1b3b124dd0
BLAKE2b-256 c18445dc94550b6ddc11ff0bc39bd36182859be9f39c9e1937ebd4924a98a6fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupaxa_expired-0.1.0.tar.gz:

Publisher: generate-release.yml on lupaxa-developers-toolbox/expired

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lupaxa_expired-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lupaxa_expired-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lupaxa_expired-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3a2fa30388a6c2c91bfc4065be1fb784985dd1b03d55dc334925484e1508b72
MD5 058049955d78ac0656b24e3c8ddd06a2
BLAKE2b-256 64e45d61e73db5207dfee7cee35fc6d9f55a778dc1dce502437f1b42d001244b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupaxa_expired-0.1.0-py3-none-any.whl:

Publisher: generate-release.yml on lupaxa-developers-toolbox/expired

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page