pkglog


Namepkglog JSON
Version 1.30 PyPI version JSON
download
home_page
SummaryReports concise log of package changes
upload_time2024-01-24 01:31:13
maintainer
docs_urlNone
author
requires_python>=3.7
licenseGPLv3
keywords pacman apt-get apt dnf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## PKGLOG - Linux utility to output concise log of package changes
[![PyPi](https://img.shields.io/pypi/v/pkglog)](https://pypi.org/project/pkglog/)
[![AUR](https://img.shields.io/aur/version/pkglog)](https://aur.archlinux.org/packages/pkglog/)

This is a Linux command line utility to output a concise list of
packages installed, removed, upgraded, downgraded, or reinstalled. It
should be able to parse package log formats used by the common Linux
distributions. Example output is shown below.

![screenshot](https://user-images.githubusercontent.com/217011/195960110-02a43a1c-366a-4e61-9372-10c4f1f4c55f.png)

1. Most terminals show this output in color, as seen above. Five
   different colors are used to identify the package actions as shown
   in the table below. You can choose to disable colored output.

2. Changes are grouped together by time so you can distinguish the group
   of packages changed each time you did package
   updates/installs/removal. By default, all changes with less than a
   succeeding 2 minute gap between any of them are grouped together, but
   you can change that time value.

3. By default, only package changes over the last 30 days are shown. You
   can choose to specify the number of days back, or from a specific
   date (optionally plus a time, or specify just a time and today is
   assumed), since last boot, or for all time.

4. The `LAST SYSTEM BOOT` line shows you which packages have been
   changed since the last boot, e.g. if the linux kernel package has
   updated you may decide to reboot asap.

5. You can specify a package name and only changes to that package are
   shown. See the USAGE section below.

6. You can use the `-n/--installed-net` option to see a list of all
   packages currently installed and their date of installation. E.g. use
   this option after you have installed and removed a heap of trial
   packages and you want to easily see if you have actually removed all
   of them and their dependencies. E.g. `pkglog -n -d0` shows a net
   summary of packages you ended up installing today. Refer to the
   [Installed Net Output Options](#installed-net-output-options) section below.

See the latest documentation and code at https://github.com/bulletmark/pkglog.

## Colored Output Lines

|Package Action|Line Text Color
|--------------|-----
|Installed     |green
|Removed       |red
|Upgraded      |yellow
|Downgraded    |magenta
|Reinstalled   |cyan

You can use a command line option to disable colors explicitly, or set
that option disabled as a [default option](#default-options).

## Log File Formats

Parsers for the following log formats currently exist. The appropriate
parser for you system is normally automatically determined.
Alternatively, you can choose the log file path[s], and/or parser
explicitly. You can also set these as [default
options](#default-options).

A very simple parser plugin architecture is used, so creating a new
parser is easy. Use the `-f/--parser-file` option to explicitly specify
the path to your custom parser for development. By default, parsers are
loaded from the `parsers/` sub-directory so, if cloning, forking, or
submitting a PR for the software, then simply place your custom parser
file in that directory and the program will automatically recognise it.
See the [current parsers](pkglog/parsers) for example code.

|Log Parser|Default Path           |Distribution       |
|----------|-----------------------|-------------------|
|apt       |`/var/log/apt/history*`|Debian, Ubuntu, etc|
|dnf       |`/var/log/dnf.rpm.log` |RedHat, Fedora, etc|
|pacman    |`/var/log/pacman.log`  |Arch, Manjaro, etc |
|zypper    |`/var/log/zypp/history`|OpenSUSE           |

## Usage

Type `pkglog -h` to view the usage summary:

```
usage: pkglog [-h] [-u | -i | -I | -n] [-N INSTALLED_NET_DAYS]
                   [-d DAYS | -a | -b] [-j] [-v] [-c]
                   [-p {pacman,zypper,apt,dnf} | -f PARSER_PLUGIN]
                   [-t TIMEGAP] [-P PATH] [-g | -r] [-V]
                   [package]

Reports concise log of package changes.

positional arguments:
  package               specific package name to report

options:
  -h, --help            show this help message and exit
  -u, --updated-only    show updated only
  -i, --installed       show installed/removed only
  -I, --installed-only  show installed only
  -n, --installed-net   show net installed only
  -N INSTALLED_NET_DAYS, --installed-net-days INSTALLED_NET_DAYS
                        days previously removed before being re-considered as
                        new net installed, default=2. Set to 0 to disable.
  -d DAYS, --days DAYS  show all packages only from given number of days ago,
                        or from given YYYY-MM-DD[?HH:MM[:SS]],
                        default=30(days), 0=today, -1=all. If only time is
                        specified, then today is assumed.
  -a, --alldays         show all packages for all days (same as "--days=-1")
  -b, --boot            show only packages updated since last boot
  -j, --nojustify       don't right justify version numbers
  -v, --verbose         be verbose, describe upgrades/downgrades
  -c, --no-color        do not color output lines
  -p {pacman,zypper,apt,dnf}, --parser {pacman,zypper,apt,dnf}
                        log parser type, default=pacman
  -f PARSER_PLUGIN, --parser-plugin PARSER_PLUGIN
                        path to alternate custom parser plugin file
  -t TIMEGAP, --timegap TIMEGAP
                        max minutes gap between grouped changes, default=2
  -P PATH, --path PATH  alternate log path[s] (separate multiple using ":",
                        must be time sequenced)
  -g, --glob            given package name is glob pattern to match
  -r, --regex           given package name is regular expression to match
  -V, --version         show pkglog version

Note you can set default starting options in ~/.config/pkglog-flags.conf.
```

## Installed Net Output Options

The purpose of the `-n/--installed-net` option is perhaps not
intuitively clear so this section explains it by way of an example.

There are times when experimenting etc that I install and remove a heap
of various packages, e.g. over a few hours or days. At the end of that
experiment I remove all the packages I believe I installed for my
experiment. However, I am never too sure I have removed everything, e.g.
some dependencies that were automatically installed. So I type:

```bash
$ pkglog -d4 -n
```

The above shows the "net" packages have ended up installed over the last 4
days, i.e. those that were newly installed in the last 4 days and not
yet removed. I can then manually remove any packages I see listed that I
don't want.

There are some favorite packages which I normally have always installed
but I may remove very temporarily for some reason. Since these packages
then appear "newly" installed then they may be undesirably listed in the
`-n/--installed-net` output. To avoid this the `-N/--installed-net-days`
option, by default set to 2 days, removes packages from the
`-n/--installed-net` output which were previously uninstalled only for
that specified number of days or less. You can disable this filter
option by setting it to 0, e.g. as a [default option](#default-options).

## Default Options

You can add default options to a personal configuration file
`~/.config/pkglog-flags.conf`. If that file exists then each line of
options in the file will be concatenated and automatically prepended
to your `pkglog` command line options.

This allow you to set default preferred starting options to `pkglog`.
Type `pkglog -h` to see the options supported.
E.g. `echo "--days 7" >~/.config/pkglog-flags.conf` to make `pkglog`
only display the last 7 days of changes by default. This is also useful
to set your parser explicitly using `-p/--parser` (e.g. if the default
parser is not automatically determined correctly on your system).

## Installation

Arch Linux users can install [pkglog from the
AUR](https://aur.archlinux.org/packages/pkglog).

Python 3.7 or later is required.
Note [pkglog is on PyPI](https://pypi.org/project/pkglog/) so just
ensure that [`pipx`](https://pypa.github.io/pipx/) is installed then
type the following:

```
$ pipx install pkglog
```

To upgrade:

```
$ pipx upgrade pkglog
```

Note that python package
[`looseversion`](https://pypi.org/project/looseversion/) is also
required if you want to parse zypper logs:

```
$ pipx inject pkglog looseversion
```

## License

Copyright (C) 2020 Mark Blakeney. This program is distributed under the
terms of the GNU General Public License.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or any later
version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License at <http://www.gnu.org/licenses/> for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pkglog",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "pacman,apt-get,apt,dnf",
    "author": "",
    "author_email": "Mark Blakeney <mark.blakeney@bullet-systems.net>",
    "download_url": "https://files.pythonhosted.org/packages/1c/42/8f9a879735b4985dc0f65334012f6d3e9b1a64019b06e4016ae97cce3828/pkglog-1.30.tar.gz",
    "platform": null,
    "description": "## PKGLOG - Linux utility to output concise log of package changes\n[![PyPi](https://img.shields.io/pypi/v/pkglog)](https://pypi.org/project/pkglog/)\n[![AUR](https://img.shields.io/aur/version/pkglog)](https://aur.archlinux.org/packages/pkglog/)\n\nThis is a Linux command line utility to output a concise list of\npackages installed, removed, upgraded, downgraded, or reinstalled. It\nshould be able to parse package log formats used by the common Linux\ndistributions. Example output is shown below.\n\n![screenshot](https://user-images.githubusercontent.com/217011/195960110-02a43a1c-366a-4e61-9372-10c4f1f4c55f.png)\n\n1. Most terminals show this output in color, as seen above. Five\n   different colors are used to identify the package actions as shown\n   in the table below. You can choose to disable colored output.\n\n2. Changes are grouped together by time so you can distinguish the group\n   of packages changed each time you did package\n   updates/installs/removal. By default, all changes with less than a\n   succeeding 2 minute gap between any of them are grouped together, but\n   you can change that time value.\n\n3. By default, only package changes over the last 30 days are shown. You\n   can choose to specify the number of days back, or from a specific\n   date (optionally plus a time, or specify just a time and today is\n   assumed), since last boot, or for all time.\n\n4. The `LAST SYSTEM BOOT` line shows you which packages have been\n   changed since the last boot, e.g. if the linux kernel package has\n   updated you may decide to reboot asap.\n\n5. You can specify a package name and only changes to that package are\n   shown. See the USAGE section below.\n\n6. You can use the `-n/--installed-net` option to see a list of all\n   packages currently installed and their date of installation. E.g. use\n   this option after you have installed and removed a heap of trial\n   packages and you want to easily see if you have actually removed all\n   of them and their dependencies. E.g. `pkglog -n -d0` shows a net\n   summary of packages you ended up installing today. Refer to the\n   [Installed Net Output Options](#installed-net-output-options) section below.\n\nSee the latest documentation and code at https://github.com/bulletmark/pkglog.\n\n## Colored Output Lines\n\n|Package Action|Line Text Color\n|--------------|-----\n|Installed     |green\n|Removed       |red\n|Upgraded      |yellow\n|Downgraded    |magenta\n|Reinstalled   |cyan\n\nYou can use a command line option to disable colors explicitly, or set\nthat option disabled as a [default option](#default-options).\n\n## Log File Formats\n\nParsers for the following log formats currently exist. The appropriate\nparser for you system is normally automatically determined.\nAlternatively, you can choose the log file path[s], and/or parser\nexplicitly. You can also set these as [default\noptions](#default-options).\n\nA very simple parser plugin architecture is used, so creating a new\nparser is easy. Use the `-f/--parser-file` option to explicitly specify\nthe path to your custom parser for development. By default, parsers are\nloaded from the `parsers/` sub-directory so, if cloning, forking, or\nsubmitting a PR for the software, then simply place your custom parser\nfile in that directory and the program will automatically recognise it.\nSee the [current parsers](pkglog/parsers) for example code.\n\n|Log Parser|Default Path           |Distribution       |\n|----------|-----------------------|-------------------|\n|apt       |`/var/log/apt/history*`|Debian, Ubuntu, etc|\n|dnf       |`/var/log/dnf.rpm.log` |RedHat, Fedora, etc|\n|pacman    |`/var/log/pacman.log`  |Arch, Manjaro, etc |\n|zypper    |`/var/log/zypp/history`|OpenSUSE           |\n\n## Usage\n\nType `pkglog -h` to view the usage summary:\n\n```\nusage: pkglog [-h] [-u | -i | -I | -n] [-N INSTALLED_NET_DAYS]\n                   [-d DAYS | -a | -b] [-j] [-v] [-c]\n                   [-p {pacman,zypper,apt,dnf} | -f PARSER_PLUGIN]\n                   [-t TIMEGAP] [-P PATH] [-g | -r] [-V]\n                   [package]\n\nReports concise log of package changes.\n\npositional arguments:\n  package               specific package name to report\n\noptions:\n  -h, --help            show this help message and exit\n  -u, --updated-only    show updated only\n  -i, --installed       show installed/removed only\n  -I, --installed-only  show installed only\n  -n, --installed-net   show net installed only\n  -N INSTALLED_NET_DAYS, --installed-net-days INSTALLED_NET_DAYS\n                        days previously removed before being re-considered as\n                        new net installed, default=2. Set to 0 to disable.\n  -d DAYS, --days DAYS  show all packages only from given number of days ago,\n                        or from given YYYY-MM-DD[?HH:MM[:SS]],\n                        default=30(days), 0=today, -1=all. If only time is\n                        specified, then today is assumed.\n  -a, --alldays         show all packages for all days (same as \"--days=-1\")\n  -b, --boot            show only packages updated since last boot\n  -j, --nojustify       don't right justify version numbers\n  -v, --verbose         be verbose, describe upgrades/downgrades\n  -c, --no-color        do not color output lines\n  -p {pacman,zypper,apt,dnf}, --parser {pacman,zypper,apt,dnf}\n                        log parser type, default=pacman\n  -f PARSER_PLUGIN, --parser-plugin PARSER_PLUGIN\n                        path to alternate custom parser plugin file\n  -t TIMEGAP, --timegap TIMEGAP\n                        max minutes gap between grouped changes, default=2\n  -P PATH, --path PATH  alternate log path[s] (separate multiple using \":\",\n                        must be time sequenced)\n  -g, --glob            given package name is glob pattern to match\n  -r, --regex           given package name is regular expression to match\n  -V, --version         show pkglog version\n\nNote you can set default starting options in ~/.config/pkglog-flags.conf.\n```\n\n## Installed Net Output Options\n\nThe purpose of the `-n/--installed-net` option is perhaps not\nintuitively clear so this section explains it by way of an example.\n\nThere are times when experimenting etc that I install and remove a heap\nof various packages, e.g. over a few hours or days. At the end of that\nexperiment I remove all the packages I believe I installed for my\nexperiment. However, I am never too sure I have removed everything, e.g.\nsome dependencies that were automatically installed. So I type:\n\n```bash\n$ pkglog -d4 -n\n```\n\nThe above shows the \"net\" packages have ended up installed over the last 4\ndays, i.e. those that were newly installed in the last 4 days and not\nyet removed. I can then manually remove any packages I see listed that I\ndon't want.\n\nThere are some favorite packages which I normally have always installed\nbut I may remove very temporarily for some reason. Since these packages\nthen appear \"newly\" installed then they may be undesirably listed in the\n`-n/--installed-net` output. To avoid this the `-N/--installed-net-days`\noption, by default set to 2 days, removes packages from the\n`-n/--installed-net` output which were previously uninstalled only for\nthat specified number of days or less. You can disable this filter\noption by setting it to 0, e.g. as a [default option](#default-options).\n\n## Default Options\n\nYou can add default options to a personal configuration file\n`~/.config/pkglog-flags.conf`. If that file exists then each line of\noptions in the file will be concatenated and automatically prepended\nto your `pkglog` command line options.\n\nThis allow you to set default preferred starting options to `pkglog`.\nType `pkglog -h` to see the options supported.\nE.g. `echo \"--days 7\" >~/.config/pkglog-flags.conf` to make `pkglog`\nonly display the last 7 days of changes by default. This is also useful\nto set your parser explicitly using `-p/--parser` (e.g. if the default\nparser is not automatically determined correctly on your system).\n\n## Installation\n\nArch Linux users can install [pkglog from the\nAUR](https://aur.archlinux.org/packages/pkglog).\n\nPython 3.7 or later is required.\nNote [pkglog is on PyPI](https://pypi.org/project/pkglog/) so just\nensure that [`pipx`](https://pypa.github.io/pipx/) is installed then\ntype the following:\n\n```\n$ pipx install pkglog\n```\n\nTo upgrade:\n\n```\n$ pipx upgrade pkglog\n```\n\nNote that python package\n[`looseversion`](https://pypi.org/project/looseversion/) is also\nrequired if you want to parse zypper logs:\n\n```\n$ pipx inject pkglog looseversion\n```\n\n## License\n\nCopyright (C) 2020 Mark Blakeney. This program is distributed under the\nterms of the GNU General Public License.\nThis program is free software: you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or any later\nversion.\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\nPublic License at <http://www.gnu.org/licenses/> for more details.\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Reports concise log of package changes",
    "version": "1.30",
    "project_urls": {
        "Homepage": "https://github.com/bulletmark/pkglog"
    },
    "split_keywords": [
        "pacman",
        "apt-get",
        "apt",
        "dnf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ea0715eb91e7bd602bfe78cf478f17989e8a09a490749e802f7087734fbff2b8",
                "md5": "a7a6e5b4e41577bda2daaeacb7ab8109",
                "sha256": "5f01be8c7948a02d193b062e1b85a1be9eebce0356f3f14bc23020800087b613"
            },
            "downloads": -1,
            "filename": "pkglog-1.30-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a7a6e5b4e41577bda2daaeacb7ab8109",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12600,
            "upload_time": "2024-01-24T01:31:10",
            "upload_time_iso_8601": "2024-01-24T01:31:10.743359Z",
            "url": "https://files.pythonhosted.org/packages/ea/07/15eb91e7bd602bfe78cf478f17989e8a09a490749e802f7087734fbff2b8/pkglog-1.30-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c428f9a879735b4985dc0f65334012f6d3e9b1a64019b06e4016ae97cce3828",
                "md5": "86a638d8607793b9d447b979474f9957",
                "sha256": "58742d220dd22840c9eda25bda9f0e72f0037f05e7b6a4090d0e9d8f9f13482b"
            },
            "downloads": -1,
            "filename": "pkglog-1.30.tar.gz",
            "has_sig": false,
            "md5_digest": "86a638d8607793b9d447b979474f9957",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14559,
            "upload_time": "2024-01-24T01:31:13",
            "upload_time_iso_8601": "2024-01-24T01:31:13.059465Z",
            "url": "https://files.pythonhosted.org/packages/1c/42/8f9a879735b4985dc0f65334012f6d3e9b1a64019b06e4016ae97cce3828/pkglog-1.30.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-24 01:31:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bulletmark",
    "github_project": "pkglog",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pkglog"
}
        
Elapsed time: 0.19264s