Skip to main content

utmp/wtmp reader

Project description

====
utmp
====

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 2.7.

Python 3.x users: use utmp_. This is a fork of utmp_ which adds nothing but a dependency on enum_, since it's not part of the Python 2.x stdlib.

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:

.. code-block:: python

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

.. _pyutmp: https://pypi.python.org/pypi/pyutmp

Project details


Download files

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

Source Distribution

python2-utmp-0.4.2.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file python2-utmp-0.4.2.tar.gz.

File metadata

  • Download URL: python2-utmp-0.4.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python2-utmp-0.4.2.tar.gz
Algorithm Hash digest
SHA256 bf134477a27ec85432ab2941e595cbcae971c594635052a10f851f4c8d107635
MD5 8e5955c71894cd6cf2a3bb6ce07b814d
BLAKE2b-256 214a61c7a6bd4d2023129d976eeff9690b58e913668332743c770a6e39298397

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