skip to navigation
skip to content

Not Logged In

ntplib 0.3.3

Python NTP library


This module offers a simple interface to query NTP servers from Python.

It also provides utility functions to translate NTP fields values to text (mode, leap indicator…). Since it’s pure Python, and only depends on core modules, it should work on any platform with a Python implementation.


>>> import ntplib
>>> from time import ctime
>>> c = ntplib.NTPClient()
>>> response = c.request('', version=3)
>>> response.offset
>>> response.version
>>> ctime(response.tx_time)
'Sun May 17 09:32:48 2009'
>>> ntplib.leap_to_text(response.leap)
'no warning'
>>> response.root_delay
>>> ntplib.ref_id_to_text(response.ref_id)


As root:

# python install

or just copy inside a directory in your sys.path, e.g. /usr/lib/python2.5/.

File Type Py Version Uploaded on Size
ntplib-0.3.3.tar.gz (md5) Source 2015-07-27 6KB
  • Downloads (All Versions):
  • 231 downloads in the last day
  • 1723 downloads in the last week
  • 8021 downloads in the last month