--- id: ntplib version: "0.4.0" license: MIT license_treatment: permissive maintenance: dormant --- # ntplib — Python NTP library License: permissive · Maintenance: dormant · Downloads: 1.3M/mo ## What it is and what it does ntplib is a pure-Python NTP (Network Time Protocol) client that queries NTP servers and retrieves time synchronization data. It provides a simple interface to request time information from any NTP server and includes utility functions to decode NTP protocol fields—such as leap indicators, reference IDs, and mode values—into human-readable text. Because it depends only on Python's standard library, it runs on any platform with a Python interpreter. The package is typically used to fetch accurate network time, calculate clock offset, or verify time synchronization in applications that need to know the precise time or detect clock drift. It returns structured response objects containing offset, delay, version, and other NTP metrics that applications can use directly or for logging and diagnostics. Use it for: - Fetch current network time and clock offset to synchronize or verify system time in applications. - Detect and measure clock drift by querying multiple NTP servers and comparing their responses. - Log or display NTP diagnostic information (leap warnings, reference IDs, root delay) for time-sensitive systems. - Validate that a system's clock is synchronized within acceptable bounds before running time-critical operations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Query NTP servers to retrieve network time synchronization data and translate NTP protocol fields into human-readable text. Yes, if you need a lightweight, dependency-free NTP client for Python. The low install friction and permissive license make it straightforward to add. However, be aware that maintenance is dormant—the last release was in 2021 and the repository has not been updated since April 2024. If you require active support or compatibility guarantees with the latest Python versions, verify that the package works in your environment first. ## Install pip install ntplib uv add ntplib poetry add ntplib ## Installing ntplib Before you install: Low install friction with no runtime dependencies beyond Python's standard library. Maintenance is dormant—last release was in 2021 and the repository has not been updated since April 2024, though it remains unarchived and receives occasional attention. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: import ntplib from time import ctime c = ntplib.NTPClient() response = c.request('pool.ntp.org', version=3) print(response.offset) print(ctime(response.tx_time)) print(ntplib.leap_to_text(response.leap)) Verify before relying: - Whether the package works reliably with modern Python versions beyond 3.9, given the last release was in 2021. - Current compatibility with contemporary NTP server implementations and protocol changes since 2021. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ntp client library python, network time protocol query, time synchronization python, ntp server request, system time sync library, ntp leap indicator, network time offset, time-sync, network-protocol [View on SkillFed](https://skillfed.io/packages/ntplib) · [View on PyPI](https://pypi.org/project/ntplib/)