Skip to content

Commit 3d1f926

Browse files
authored
Merge pull request #24 from liquidz00/develop
Merge version 2.0 functionality from develop into main
2 parents 2887273 + 70728eb commit 3d1f926

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5385
-2247
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
SHELL := /bin/bash
22
.PHONY: docs
33

4+
install:
5+
python3 -m pip install --upgrade --force-reinstall --editable '.[all]'
6+
47
install-dev:
58
python3 -m pip install --upgrade --force-reinstall --editable '.[dev]'
69

@@ -32,3 +35,4 @@ build:
3235

3336
docs:
3437
sphinx-build -b html docs/ docs/_build/
38+

README.md

+43-21
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,59 @@
1-
# Patcher
2-
3-
_Patch reporting simplified_
1+
<p align="left">
2+
<a href="https://patcher.liquidzoo.io/">
3+
<img src="docs/_static/patcher-banner-readme.svg" width="540"/>
4+
</a>
5+
</p>
46

57
![](https://img.shields.io/pypi/l/patcherctl)&nbsp;![](https://img.shields.io/badge/Python-3.10+-3776AB.svg?style=flat&logo=python&logoColor=white)&nbsp;![](https://img.shields.io/github/v/release/liquidz00/Patcher?color=orange)&nbsp;![](https://github.com/liquidz00/patcher/actions/workflows/pytest.yml/badge.svg)&nbsp;![](https://img.shields.io/pypi/v/patcherctl?color=yellow)
68

9+
----
710

8-
Patcher leverages the Jamf Pro API to fetch patch management data and generate comprehensive reports in both Excel and PDF formats. It simplifies tracking and reporting on software update compliance across macOS devices managed through Jamf Pro.
11+
# Patcher
912

10-
## Documentation
11-
Project documentation can now be found [on our project homepage](https://patcher.liquidzoo.io). All content from our project wiki has been migrated to the new homepage. We are continuously updating references to the new homepage and regularly improving the documentation.
13+
_Simplified patch reporting_
1214

13-
### Sample PDF
14-
Assuming 'AnyOrg' is the name of your organization, an exported PDF could look like this:
15-
<p align="left"><img src="docs/_static/example_pdf.png" width="750"/></p>
15+
<p align="left">
16+
<img src="https://cdn.worldvectorlogo.com/logos/slack-new-logo.svg" width="16" style="vertical-align: middle; margin-right: 5px;"/>
17+
Find us in the <code>#patcher</code> channel in the <a href="https://www.macadmins.org">MacAdmins Slack</a>
18+
</p>
19+
20+
## What is Patcher?
21+
Patcher is a Command Line Interface (CLI) tool for macOS that leverages the Jamf Pro API to fetch patch management data and generates comprehensive reports in varying formats. It simplifies tracking and reporting on software update compliance across macOS devices managed through Jamf Pro.
1622

17-
### Installation
18-
Install via `pip`:
23+
Read the full project documentation [on our project homepage](https://patcher.liquidzoo.io).
1924

20-
```shell
21-
pip install patcherctl
25+
## Installation
26+
Install releases from PyPI:
27+
28+
```console
29+
$ python3 -m pip install patcherctl
2230
```
31+
2332
> [!NOTE]
2433
> Please note that while Patcher is installed as a package, it is meant to be used as a command line tool and not as an imported library.
2534
26-
*Why `patcherctl?` The pip package is called patcherctl because the name patcher was already taken on PyPI. Despite this, the project itself is referred to as Patcher*
35+
## Sample PDF
36+
Assuming 'AnyOrg' is the name of your organization, an exported PDF could look like this:
37+
<p align="left"><img src="docs/_static/example_pdf.png" width="750"/></p>
38+
39+
PDF Reports can be customized to fit your organizations branding needs. See the [customizing reports](https://patcher.liquidzoo.io/user/customize_reports.html) in the project docs.
40+
41+
## Usage
42+
For a list of all available commands and options, visit the [usage page](https://patcher.liquidzoo.io/user/usage.html) of our documentation.
2743

28-
### Usage
29-
After installation, you can generate reports by running the main script. You can specify the output directory for the reports and choose to generate PDF reports alongside Excel files.
30-
```shell
31-
patcherctl --path '/path/to/output/directory' [--pdf]
44+
After installation, reports can be generated by running the `export` command. You can specify the output directory for the reports and choose to generate PDF reports alongside Excel files.
45+
46+
```console
47+
$ patcherctl export --path '/path/to/output/directory' [--pdf]
3248
```
3349

34-
For a list of all available command options, visit the [usage page](https://patcher.liquidzoo.io/user/usage.html) of our documentation.
50+
***
51+
52+
## Contributing
53+
54+
[Contributions](https://patcher.liquidzoo.io/contributing/index.html) to Patcher are welcome! We have set up templates for submitting [issues](https://github.com/liquidz00/Patcher/issues/new?template=issue.md), [feature requests](https://github.com/liquidz00/Patcher/issues/new?template=feature_request.md), and [feedback](https://github.com/liquidz00/Patcher/issues/new?template=feedback.md). Please be sure to utilize these templates when contributing to the project.
3555

36-
## Authors & Contributions
37-
Patcher is co-authored by [Andrew Speciale - @liquidz00](https://github.com/liquidz00) and [Chris Ball - @ball42](https://github.com/ball42). [Contributions](https://patcher.liquidzoo.io/contributing/index.html) to Patcher are welcome! We have set up templates for submitting issues, feature requests, and feedback. Please be sure to utilize these templates when contributing to the project.
56+
<!--
57+
Author: Andrew Lerman
58+
Keywords: patcher patcherctl jamf jamfpro macos patch patchmanagement apple
59+
-->

docs/_static/css/custom.css

+17
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,20 @@ div.admonition.admonition-optional > .admonition-title::after {
5959
color: hsl(0 0% 30%);
6060
content: "\f08d";
6161
}
62+
63+
.patcher-banner {
64+
display: block;
65+
margin: 20px;
66+
max-width: 720px;
67+
height: auto;
68+
clear: both; /* Prevent text or floated elements from wrapping */
69+
}
70+
71+
html[data-theme="dark"] .patcher-banner {
72+
background-color: transparent;
73+
}
74+
75+
.patcher-banner + * {
76+
clear: both;
77+
margin-top: 20px;
78+
}

docs/_static/patcher-banner-readme.svg

+1
Loading

docs/_static/v2-logo-dark.svg

+1
Loading

docs/_static/v2-logo-favicon.svg

+1
Loading

docs/_static/v2-logo.svg

+1
Loading

docs/_static/v2-patcher-banner-dark.svg

+8
Loading

docs/_static/v2-patcher-banner-light.svg

+8
Loading

docs/conf.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181

8282
html_baseurl = "http://patcher.liquidzoo.io"
8383
html_theme = "pydata_sphinx_theme"
84-
html_logo = "_static/logo.svg"
85-
html_favicon = "_static/logo.svg"
84+
html_logo = "_static/v2-logo.svg"
85+
html_favicon = "_static/v2-logo-favicon.svg"
8686
html_static_path = ["_static"]
8787
html_title = f"{release}"
8888

@@ -116,10 +116,15 @@
116116
"url": "https://pypi.org/project/patcherctl/",
117117
"icon": "fab fa-python",
118118
},
119+
{
120+
"name": "MacAdmins Slack",
121+
"url": "https://macadmins.slack.com/archives/C07EH1R7LB0",
122+
"icon": "fab fa-slack",
123+
},
119124
],
120125
"logo": {
121126
"text": "Patcher",
122-
"image_dark": "_static/logo-dark.svg",
127+
"image_dark": "_static/v2-logo-dark.svg",
123128
},
124129
"footer_start": ["copyright"],
125130
"footer_end": ["theme-version"],
@@ -128,6 +133,8 @@
128133
"**/*": ["page-toc", "sourcelink"],
129134
},
130135
"show_toc_level": 3,
136+
"pygments_light_style": "xcode",
137+
"pygments_dark_style": "github-dark",
131138
}
132139

133140
# Remove primary sidebar from contributing page

docs/contributing/index.rst

-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ Contributing
55

66
Contributions to Patcher are encouraged and welcomed. Contributing does not *have* to mean writing Python code! Project documentation can always be improved and `feature requests <https://github.com/liquidz00/Patcher/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=%5BFEATURE%5D+Your+feature+request+title>`_ can be submitted for new ideas or functionality. We, the developers of this tool, **firmly believe** that diverse backgrounds strengthen a product. Therefore, we encourage you to share your ideas and thoughts, regardless of your programming experience.
77

8-
Some topics we are hoping to develop in future versions of Patcher are:
9-
10-
- **Support for other MDM vendors**; Implementing functionality for other MDM vendors (such as Kandji)
11-
- **Windows compatibility**; whether via Docker container or additional windows-specific credential libraries
12-
- **Patch analyzation**; providing information on which patch titles may need TLC above others (e.g., titles that have been released longer than 'x' amount of time that have active CVEs)
13-
- **Installomator support**; identifying which patch titles have an `Installomator <https://github.com/Installomator/Installomator>`_ label available to assist Admins in setting up automatic patching.
14-
158
How to Contribute
169
-----------------
1710

docs/index.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,38 @@
22
html_theme.sidebar_secondary.remove: True
33
---
44

5-
# Patcher
5+
```{image} _static/v2-patcher-banner-light.svg
6+
:class: only-light patcher-banner
7+
:align: center
8+
```
69

7-
*Patch reporting simplified*
10+
```{image} _static/v2-patcher-banner-dark.svg
11+
:class: only-dark patcher-banner
12+
:align: center
13+
```
814

9-
## Welcome to Patcher's Documentation!
15+
# 👋 Welcome to Patcher's Documentation!
1016

1117
Patcher is crafted with the needs of Mac Admins in mind, offering a streamlined approach to the often complex and time-consuming task of patch management. By automating the extraction and formatting of patch data, Patcher not only saves time but also ensures accuracy and consistency in the management of software updates.
1218

19+
***
20+
21+
## Features
22+
23+
- **Real-Time Patch Information Export**: Quickly extract up-to-date patch data for analysis.
24+
- **Excel Spreadsheet Integration**: Seamlessly export patch information into Excel for in-depth analysis and record-keeping.
25+
- **PDF Reporting**: Generate neatly formatted PDFs for easy sharing and documentation of patch statuses.
26+
- **Customization Options**: Tailor the tool to match your organizations branding scheme with custom fonts and logo support.
27+
- **Analysis**: Quickly analyze Patch Reports to identify which software titles may need some extra TLC.
28+
1329
::::{grid} 1 1 1 3
1430
:gutter: 2
1531
:padding: 2 2 0 0
1632
:class-container: sd-text-center
1733

1834
:::{grid-item-card} {fas}`user;sd-text-primary` User Guide
1935
:class-card: sd-card
36+
:class-title: patcher-title
2037
:shadow: md
2138
:columns: 12
2239

@@ -37,6 +54,7 @@ User Guide
3754

3855
:::{grid-item-card} {fas}`book;sd-text-primary` Reference
3956
:class-card: sd-card
57+
:class-title: patcher-title
4058
:shadow: md
4159
:columns: 6
4260

@@ -57,6 +75,7 @@ Reference Guide
5775

5876
:::{grid-item-card} {fas}`hands-helping;sd-text-primary` Contributing
5977
:class-card: sd-card
78+
:class-title: patcher-title
6079
:shadow: md
6180
:columns: 6
6281

docs/reference/analyze.rst

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
:html_theme.sidebar_secondary.remove: True
2+
3+
.. _analyzer:
4+
5+
========
6+
Analyzer
7+
========
8+
9+
BaseEnum
10+
--------
11+
12+
.. autoclass:: patcher.client.analyze.BaseEnum
13+
:members:
14+
15+
FilterCriteria
16+
--------------
17+
18+
.. autoclass:: patcher.client.analyze.FilterCriteria
19+
:members:
20+
21+
TrendCriteria
22+
-------------
23+
24+
.. autoclass:: patcher.client.analyze.TrendCriteria
25+
:members:
26+
27+
Analyzer Class
28+
--------------
29+
30+
.. autoclass:: patcher.client.analyze.Analyzer
31+
:members:
32+

docs/reference/cli.rst

+63-34
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,83 @@
22

33
.. _cli:
44

5-
======================
6-
Command Line Interface
7-
======================
5+
============================
6+
Command Line Interface (CLI)
7+
============================
88

9-
.. note::
9+
Entry Point
10+
-----------
1011

11-
The CLI entry point collaborates with the :mod:`~patcher.client.report_manager` module. Most of the operations are managed by the Report Manager class, where debug logs are also generated, rather than within the CLI entry point.
12+
.. function:: cli(ctx: click.Context, debug: bool) -> None
1213

13-
The main entry point for the Patcher CLI (patcherctl).
14+
Main entry point for the CLI.
1415

15-
Parameters
16-
----------
16+
:param ctx: The Click context object.
17+
:type ctx: click.Context
18+
:param debug: Enable debug logging if `True`.
19+
:type debug: :py:class:`bool`
1720

18-
- **ctx** (*click.Context*):
19-
Click context object. Used to ensure either the ``--path`` argument OR the ``--reset`` argument is supplied at runtime.
21+
**Options**:
22+
- ``--debug``, ``-x``: Enable verbose logging.
2023

21-
- **path** (*AnyStr*):
22-
The path to save the report(s).
24+
Subcommands
25+
-----------
2326

24-
- **pdf** (*bool*):
25-
If passed, Patcher will generate a PDF report along with the Excel spreadsheet using the :mod:`~patcher.models.reports.pdf_report` model.
27+
.. admonition:: Added in version 2.0
28+
:class: success
2629

27-
- **sort** (*Optional[AnyStr]*):
28-
Sort patch reports by a specified column.
30+
Patcher has been split into three separate commands; ``analyze``, ``reset`` and ``export``. For usage and examples, see our `Usage <usage>` page.
2931

30-
.. note::
31-
Patcher handles the automatic conversion of the column name on your behalf. For example, if sorting by completion percent, simply pass "Completion Percent" at runtime.
32+
Reset Command
33+
^^^^^^^^^^^^^
3234

33-
- **omit** (*bool*):
34-
If passed, software titles with patches released in the last 48 hours will be omitted from the exported report(s).
35+
.. function:: reset(ctx: click.Context, kind: str, credential: Optional[str]) -> None
3536

36-
- **date_format** (*AnyStr*):
37-
Specify the date format for the PDF header from predefined choices. See :ref:`date format <date-format>` for more information.
37+
Resets configurations based on the specified kind.
3838

39-
- **ios** (*bool*):
40-
Include the amount of enrolled mobile devices on the latest version of their respective OS. This flag uses `SOFA <https://sofa.macadmins.io>`_ to pull latest iOS versioning data.
39+
**Arguments**:
40+
- ``ctx``: The Click context object.
41+
- ``kind``: The type of reset to perform. Options include:
4142

42-
- **concurrency** (*int*):
43-
Set the maximum concurrency level for API calls.
43+
- ``full``: Resets all configurations.
44+
- ``UI``: Resets only the UI configurations.
45+
- ``creds``: Resets credentials.
4446

45-
.. danger::
46-
Before using this argument, **please see** the :ref:`concurrency <concurrency>` documentation first.
47+
**Options**:
48+
- ``--credential``, ``-c``: Specify which credential to reset.
4749

48-
- **debug** (*bool*):
49-
Enable debug logging to see detailed debug messages. Providing this option replaces the animation usually shown to ``stdout``.
5050

51-
- **reset** (*bool*):
52-
Resets the ``config.ini`` file used for customizable elements in exported PDF reports, then triggers :func:`~patcher.client.setup._setup_ui` method. See :ref:`Customizing Reports <customize_reports>` for more information.
51+
Export Command
52+
^^^^^^^^^^^^^^
53+
54+
.. function:: export(ctx: click.Context, path: str, pdf: bool, sort: Optional[str], omit: bool, date_format: str, ios: bool, concurrency: int) -> None
55+
56+
Exports patch management data in Excel and/or PDF formats.
57+
58+
**Arguments**:
59+
- ``ctx``: The Click context object.
60+
- ``path``: File path to save the generated reports.
61+
- ``pdf``: Generate a PDF report if `True`.
62+
- ``sort``: Column to sort by.
63+
- ``omit``: Omit software titles released in the last 48 hours.
64+
- ``date_format``: Format of the date in the PDF header.
65+
- ``ios``: Include mobile device data if `True`.
66+
- ``concurrency``: Maximum number of API requests sent concurrently.
67+
68+
69+
Analyze Command
70+
^^^^^^^^^^^^^^^
71+
72+
.. function:: analyze(ctx: click.Context, excel_file: str, criteria: str, threshold: float, top_n: int, summary: bool, output_dir: Union[str, Path]) -> None
73+
74+
Analyzes exported patch management data.
75+
76+
**Arguments**:
77+
- ``ctx``: The Click context object.
78+
- ``excel_file``: Path to the Excel file to analyze.
79+
- ``criteria``: Criteria for filtering results.
80+
- ``threshold``: Threshold percentage for filtering.
81+
- ``top_n``: Limit the number of results displayed.
82+
- ``summary``: Generate a summary file if `True`.
83+
- ``output_dir``: Directory to save the summary.
5384

54-
- **custom_ca_file** (*Optional[AnyStr]*):
55-
Pass a path to a custom Certificate Authority (CA) file for SSL verification. If provided, this file will be used in place of the default CA paths. See :ref:`ssl-verify`.

docs/reference/config_manager.rst

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
Config Manager
55
==============
66

7-
.. dropdown:: Summary
8-
:icon: archive
9-
10-
The ``ConfigManager`` is responsible saving, updating and retrieving credentials from keychain.
11-
127
.. autoclass:: patcher.client.config_manager.ConfigManager
138
:members:
149

docs/reference/data_manager.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
:html_theme.sidebar_secondary.remove: True
2+
3+
=============
4+
Data Manager
5+
=============
6+
7+
.. autoclass:: patcher.utils.data_manager.DataManager
8+
:members:

0 commit comments

Comments
 (0)