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
timedeltaor 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, stdoutexpired/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/.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a126c0800ab6cfb5e223c16f75c22731e874422393a802129dbeb4275702916
|
|
| MD5 |
d19a769e180c862f67c67d1b3b124dd0
|
|
| BLAKE2b-256 |
c18445dc94550b6ddc11ff0bc39bd36182859be9f39c9e1937ebd4924a98a6fa
|
Provenance
The following attestation bundles were made for lupaxa_expired-0.1.0.tar.gz:
Publisher:
generate-release.yml on lupaxa-developers-toolbox/expired
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupaxa_expired-0.1.0.tar.gz -
Subject digest:
3a126c0800ab6cfb5e223c16f75c22731e874422393a802129dbeb4275702916 - Sigstore transparency entry: 2574901546
- Sigstore integration time:
-
Permalink:
lupaxa-developers-toolbox/expired@af2725f437a2dcbde9eb037218fa61daf947c305 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lupaxa-developers-toolbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
generate-release.yml@af2725f437a2dcbde9eb037218fa61daf947c305 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3a2fa30388a6c2c91bfc4065be1fb784985dd1b03d55dc334925484e1508b72
|
|
| MD5 |
058049955d78ac0656b24e3c8ddd06a2
|
|
| BLAKE2b-256 |
64e45d61e73db5207dfee7cee35fc6d9f55a778dc1dce502437f1b42d001244b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupaxa_expired-0.1.0-py3-none-any.whl -
Subject digest:
b3a2fa30388a6c2c91bfc4065be1fb784985dd1b03d55dc334925484e1508b72 - Sigstore transparency entry: 2574902222
- Sigstore integration time:
-
Permalink:
lupaxa-developers-toolbox/expired@af2725f437a2dcbde9eb037218fa61daf947c305 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lupaxa-developers-toolbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
generate-release.yml@af2725f437a2dcbde9eb037218fa61daf947c305 -
Trigger Event:
push
-
Statement type: