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 Distribution
Built Distribution
File details
Details for the file utmp-21.10.0.tar.gz
.
File metadata
- Download URL: utmp-21.10.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 201a758e790b6e8ad2c212388a38f20a71d508e717b714d58f1949c8fcc4de5d |
|
MD5 | c012b9862cd2f5080837054d81af93cc |
|
BLAKE2b-256 | 9e7534181e310c9ffc70535f46169807d0ff4d68b0277d79e3e255cfe6555938 |
File details
Details for the file utmp-21.10.0-py3-none-any.whl
.
File metadata
- Download URL: utmp-21.10.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01237cb4098f4fffdc32e99eda6c0230f021365dc8b987291cf6c0ce6dc5ae51 |
|
MD5 | 398b265e9233cc67c485f034bed1538e |
|
BLAKE2b-256 | ae605ef7cfd1f096e84a8a1b914aeaaf246407f9d100ae6d5eb6a8c789c365ed |