uptime
Cross-platform uptime library
What it is and what it does
Uptime is a lightweight library that retrieves how long the system has been running since its last boot. It provides both a Python API (the `uptime()` function) and a command-line interface, making it useful for monitoring, logging, or scripting tasks that need to know system uptime. The package is cross-platform in intent, with classifiers for Linux, macOS, Windows, BSD, Solaris, and other operating systems.
The library has no Python dependencies, but it relies on platform-specific system calls to fetch uptime data, which means behavior and reliability vary by OS. The package is dormant—last released in 2013, with minimal recent maintenance—so it may not work reliably on modern Python versions or newer operating systems without fixes.
Use it for:
- Monitor system uptime in a Python script or monitoring dashboard to track system stability.
- Log uptime at application startup for diagnostics or audit trails.
- Build a cross-platform system health check that includes uptime as one metric.
- Automated testing or CI/CD pipelines that need to verify system state before running tests.
- Command-line tool to quickly check when the system was last booted.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Retrieves the system uptime (time since last boot) in a cross-platform way, usable as a library function or command-line tool.
Yes, if you need a simple uptime query on a supported platform and can tolerate dormant maintenance. No, if you require active support or compatibility with modern Python 3 versions—test thoroughly on your target OS first. The lack of recent updates and unclear current license status make it risky for production use without verification.
Install
uptime on PyPI
pip
pip install uptimeuv
uv add uptimepoetry
poetry add uptimeInstalling uptime
Before you install
High install friction due to platform-specific system calls required; package is dormant (last release 2013-10-07, last commit 2024-06-10) with no runtime dependencies, so maintenance burden is minimal but updates are infrequent.
License in practice
Licensed under BSD (permissive), so commercial and private use are unrestricted; however, license_raw is marked UNKNOWN, so verify the actual license text in the repository before relying on it in a commercial context.
Quickstart
pip install uptime
from uptime import uptime
print(uptime())
# Or from command line:
python -m uptime
Requires platform-specific system calls to retrieve uptime; behavior and availability vary significantly across operating systems (Linux, macOS, Windows, BSD, Solaris, BeOS).
Verify before relying
- Whether the package actually works on all advertised platforms (BeOS, SunOS/Solaris) given its dormant maintenance status.
- Current Python version compatibility—description says 2.5+, but Python 2 is long deprecated; unclear if it works on modern Python 3 versions.
- Why install_friction is marked 'high' when there are zero runtime dependencies—likely due to compiled/system-level dependencies not captured in the metadata.
Package facts
| License | UNKNOWN (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 4,694 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 373,889/month — #7,153 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: uptime-3.0.1.tar.gz
Tags
More System packages
Provides a platform-independent file locking…
permissive · top 100 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
aiofileProvides asynchronous file I/O operations for…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
filetypeInfers file type and MIME type by examining…
permissive · top 1,000 on PyPI
coloredlogsAdds colored output to Python's standard…
permissive · top 1,000 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
uptime-kuma-apiA Python wrapper for the Uptime Kuma Socket.IO…
permissive · top 5,000 on PyPI
uptime-kuma-api-v2Provides a Python client for the Uptime Kuma…
permissive · top 15,000 on PyPI
pytimeparseParses human-readable time expressions (like…
permissive · top 1,000 on PyPI
python-crontabReads, writes, and manipulates system crontab…
copyleft · top 5,000 on PyPI
pyusbPyUSB provides Python access to USB devices on…
permissive · top 5,000 on PyPI
inputimeoutProvides cross-platform standard input with a…
permissive · top 5,000 on PyPI
extra-platformsDetects and exposes rich metadata about runtime…
permissive · top 15,000 on PyPI
py-cpuinfoDetects and reports CPU…
permissive · top 1,000 on PyPI
sysv-ipcProvides Python access to System V IPC…
permissive · top 15,000 on PyPI