Skip to main content
Help us improve Python packaging – donate today!

utmp/wtmp reader

Project Description

Pure-Python library to decode/read utmp and wtmp files. Please note that there is an alternative library which uses the underlying C API: pyutmp

This package requires Python 3.4.

What is utmp/wtmp?

utmp, wtmp, btmp and variants such as utmpx, wtmpx and btmpx are files on Unix-like systems that keep track of all logins and logouts to the system.

The utmp file keeps track of the current login state of each user. The wtmp file records all logins and logouts history. The btmp file records failed login attempts.

On Linux the wtmp and btmp files are usually located in the /var/log/ directory.


The function decodes a binary utmp/wtmp stream and yields record objects:

with open('/var/log/wtmp', 'rb') as fd:
    buf =
    for entry in
        print(entry.time, entry.type, entry)

Release history Release notifications

This version
History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
utmp-0.4.tar.gz (4.3 kB) Copy SHA256 hash SHA256 Source None Nov 14, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page