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

Release files for lupaxa-expired 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lupaxa-expired 0.1.2
File Size Uploaded
lupaxa_expired-0.1.2.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-expired 0.1.2
File Interpreter ABI Platform
lupaxa_expired-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / lupaxa_expired-0.1.2.tar.gz

Download URL lupaxa_expired-0.1.2.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
975f1ca8037a805a06c7249e693eff009c4c344ac1efbf51fa85311ae2bc8fb8
BLAKE2b-256 checksum
How to use checksums
5f7bcf384f300d4730f4d60a6a70e1ef899ef3a14e290e7fb788ae6cfececd5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / lupaxa_expired-0.1.2-py3-none-any.whl

Download URL lupaxa_expired-0.1.2-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4e81ebb14a1a8c8050549450a7b361756b666ccc27f3a44af309659d9fd444e
BLAKE2b-256 checksum
How to use checksums
d0482e56efad326a7f87147b499ddadebf4e9246a1ef2699b8bbc4ea65d6bd92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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