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.1.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.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lupaxa_expired-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8ea8a68c5edbe6266c51dcd0c6d2ebf94ef086b0744ec52839b73a8c890b258e
MD5 7e374414128dd538b774f11898e11d07
BLAKE2b-256 eb0ec7f7819ea5efefc8d04fcbb44ae1d26cf75868a483769189ad081049f985

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupaxa_expired-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: lupaxa_expired-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f936a516e689d1ab02b378bfa8635dc6f7f0ba83102181f76408115386e43d06
MD5 6737dfabe12e82582e5e42192ae344a2
BLAKE2b-256 f3d12fd3798a6cd08606ddaacd0f53155a70b9e352657a01a702fdb42ca6d161

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupaxa_expired-0.1.1-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

This release

0.1.1 This release

2 files

0.1.0

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