Skip to main content

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.

Usage

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

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

utmp-20.10.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file utmp-20.10.0-py3-none-any.whl.

File metadata

  • Download URL: utmp-20.10.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for utmp-20.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67e8181c9f727f40f15c95c69de39cfa894934a4349ffb810cb03287c9b17ac2
MD5 cc6fdc7c08955bcc8e4a3198fca2e52d
BLAKE2b-256 6a9ac479e0aaa144be142d9ee3f03ccbabe00f21215df8e09b848c1da360e93e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page