petit-log-crunchtools 3.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. petit_log_crunchtools-3.1.1/.gitignore +11 -0
  2. petit_log_crunchtools-3.1.1/AUTHORS +2 -0
  3. petit_log_crunchtools-3.1.1/CHANGELOG.md +304 -0
  4. petit_log_crunchtools-3.1.1/COPYING +666 -0
  5. petit_log_crunchtools-3.1.1/PKG-INFO +170 -0
  6. petit_log_crunchtools-3.1.1/README +145 -0
  7. petit_log_crunchtools-3.1.1/pyproject.toml +86 -0
  8. petit_log_crunchtools-3.1.1/src/petit/CrunchLog.py +728 -0
  9. petit_log_crunchtools-3.1.1/src/petit/Filter.py +103 -0
  10. petit_log_crunchtools-3.1.1/src/petit/LogGraph.py +557 -0
  11. petit_log_crunchtools-3.1.1/src/petit/LogHash.py +393 -0
  12. petit_log_crunchtools-3.1.1/src/petit/__init__.py +52 -0
  13. petit_log_crunchtools-3.1.1/src/petit/api.py +217 -0
  14. petit_log_crunchtools-3.1.1/src/petit/cli.py +329 -0
  15. petit_log_crunchtools-3.1.1/src/petit/data/filters/daemon.stopwords +6 -0
  16. petit_log_crunchtools-3.1.1/src/petit/data/filters/hash.stopwords +10 -0
  17. petit_log_crunchtools-3.1.1/src/petit/data/filters/host.stopwords +1 -0
  18. petit_log_crunchtools-3.1.1/src/petit/data/filters/words.stopwords +204 -0
  19. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/fedora11-reboot-dell.fp +650 -0
  20. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel4-reboot-dl380.fp +654 -0
  21. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel4-reboot-vmware.fp +309 -0
  22. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel5-reboot-dl380.fp +336 -0
  23. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel5-reboot-vmware.fp +268 -0
  24. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/ubuntu10.04-reboot-kvm.fp +330 -0
  25. petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/ubuntu9.04-reboot-vmware.fp +359 -0
  26. petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/fedora11-reboot.fp +650 -0
  27. petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/rhel4-reboot.fp +966 -0
  28. petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/rhel5-reboot.fp +604 -0
  29. petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/ubuntu10.04-reboot.fp +330 -0
  30. petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/ubuntu9.04-reboot.fp +359 -0
  31. petit_log_crunchtools-3.1.1/src/petit/errors.py +28 -0
  32. petit_log_crunchtools-3.1.1/src/petit/resources.py +58 -0
  33. petit_log_crunchtools-3.1.1/test/README +32 -0
  34. petit_log_crunchtools-3.1.1/test/data/test01.log +115 -0
  35. petit_log_crunchtools-3.1.1/test/data/test02.log +6 -0
  36. petit_log_crunchtools-3.1.1/test/data/test03.log +100 -0
  37. petit_log_crunchtools-3.1.1/test/data/test04.log +6 -0
  38. petit_log_crunchtools-3.1.1/test/data/test05.log +419 -0
  39. petit_log_crunchtools-3.1.1/test/data/test06.log +1070 -0
  40. petit_log_crunchtools-3.1.1/test/data/test07.log +500 -0
  41. petit_log_crunchtools-3.1.1/test/data/test08.log +1500 -0
  42. petit_log_crunchtools-3.1.1/test/data/test09.log +197 -0
  43. petit_log_crunchtools-3.1.1/test/data/test10.log +491 -0
  44. petit_log_crunchtools-3.1.1/test/data/test11.log +39 -0
  45. petit_log_crunchtools-3.1.1/test/data/test12.log +84 -0
  46. petit_log_crunchtools-3.1.1/test/data/test13.log +0 -0
  47. petit_log_crunchtools-3.1.1/test/output/test01-daemon.output +4 -0
  48. petit_log_crunchtools-3.1.1/test/output/test01-dgraph.output +13 -0
  49. petit_log_crunchtools-3.1.1/test/output/test01-hash-fingerprint.output +14 -0
  50. petit_log_crunchtools-3.1.1/test/output/test01-hash-nofilter.output +75 -0
  51. petit_log_crunchtools-3.1.1/test/output/test01-hash-nosample.output +14 -0
  52. petit_log_crunchtools-3.1.1/test/output/test01-hash.output +14 -0
  53. petit_log_crunchtools-3.1.1/test/output/test01-hgraph.output +13 -0
  54. petit_log_crunchtools-3.1.1/test/output/test01-host.output +20 -0
  55. petit_log_crunchtools-3.1.1/test/output/test01-mgraph.output +13 -0
  56. petit_log_crunchtools-3.1.1/test/output/test01-mograph.output +13 -0
  57. petit_log_crunchtools-3.1.1/test/output/test01-sgraph.output +15 -0
  58. petit_log_crunchtools-3.1.1/test/output/test01-wordcount.output +23 -0
  59. petit_log_crunchtools-3.1.1/test/output/test01-ygraph.output +13 -0
  60. petit_log_crunchtools-3.1.1/test/output/test02-daemon.output +0 -0
  61. petit_log_crunchtools-3.1.1/test/output/test02-dgraph.output +13 -0
  62. petit_log_crunchtools-3.1.1/test/output/test02-hash-fingerprint.output +6 -0
  63. petit_log_crunchtools-3.1.1/test/output/test02-hash-nofilter.output +6 -0
  64. petit_log_crunchtools-3.1.1/test/output/test02-hash-nosample.output +6 -0
  65. petit_log_crunchtools-3.1.1/test/output/test02-hash.output +6 -0
  66. petit_log_crunchtools-3.1.1/test/output/test02-hgraph.output +13 -0
  67. petit_log_crunchtools-3.1.1/test/output/test02-host.output +0 -0
  68. petit_log_crunchtools-3.1.1/test/output/test02-mgraph.output +13 -0
  69. petit_log_crunchtools-3.1.1/test/output/test02-mograph.output +13 -0
  70. petit_log_crunchtools-3.1.1/test/output/test02-sgraph.output +13 -0
  71. petit_log_crunchtools-3.1.1/test/output/test02-wordcount.output +6 -0
  72. petit_log_crunchtools-3.1.1/test/output/test02-ygraph.output +13 -0
  73. petit_log_crunchtools-3.1.1/test/output/test03-daemon.output +1 -0
  74. petit_log_crunchtools-3.1.1/test/output/test03-dgraph.output +13 -0
  75. petit_log_crunchtools-3.1.1/test/output/test03-hash-fingerprint.output +19 -0
  76. petit_log_crunchtools-3.1.1/test/output/test03-hash-nofilter.output +39 -0
  77. petit_log_crunchtools-3.1.1/test/output/test03-hash-nosample.output +19 -0
  78. petit_log_crunchtools-3.1.1/test/output/test03-hash.output +19 -0
  79. petit_log_crunchtools-3.1.1/test/output/test03-hgraph.output +13 -0
  80. petit_log_crunchtools-3.1.1/test/output/test03-host.output +39 -0
  81. petit_log_crunchtools-3.1.1/test/output/test03-mgraph.output +13 -0
  82. petit_log_crunchtools-3.1.1/test/output/test03-mograph.output +13 -0
  83. petit_log_crunchtools-3.1.1/test/output/test03-sgraph.output +14 -0
  84. petit_log_crunchtools-3.1.1/test/output/test03-wordcount.output +20 -0
  85. petit_log_crunchtools-3.1.1/test/output/test03-ygraph.output +13 -0
  86. petit_log_crunchtools-3.1.1/test/output/test04-daemon.output +0 -0
  87. petit_log_crunchtools-3.1.1/test/output/test04-dgraph.output +13 -0
  88. petit_log_crunchtools-3.1.1/test/output/test04-hash-fingerprint.output +2 -0
  89. petit_log_crunchtools-3.1.1/test/output/test04-hash-nofilter.output +6 -0
  90. petit_log_crunchtools-3.1.1/test/output/test04-hash-nosample.output +2 -0
  91. petit_log_crunchtools-3.1.1/test/output/test04-hash.output +2 -0
  92. petit_log_crunchtools-3.1.1/test/output/test04-hgraph.output +13 -0
  93. petit_log_crunchtools-3.1.1/test/output/test04-host.output +0 -0
  94. petit_log_crunchtools-3.1.1/test/output/test04-mgraph.output +13 -0
  95. petit_log_crunchtools-3.1.1/test/output/test04-mograph.output +13 -0
  96. petit_log_crunchtools-3.1.1/test/output/test04-sgraph.output +13 -0
  97. petit_log_crunchtools-3.1.1/test/output/test04-wordcount.output +3 -0
  98. petit_log_crunchtools-3.1.1/test/output/test04-ygraph.output +13 -0
  99. petit_log_crunchtools-3.1.1/test/output/test05-daemon.output +55 -0
  100. petit_log_crunchtools-3.1.1/test/output/test05-dgraph.output +14 -0
  101. petit_log_crunchtools-3.1.1/test/output/test05-hash-fingerprint.output +14 -0
  102. petit_log_crunchtools-3.1.1/test/output/test05-hash-nofilter.output +376 -0
  103. petit_log_crunchtools-3.1.1/test/output/test05-hash-nosample.output +305 -0
  104. petit_log_crunchtools-3.1.1/test/output/test05-hash.output +305 -0
  105. petit_log_crunchtools-3.1.1/test/output/test05-hgraph.output +13 -0
  106. petit_log_crunchtools-3.1.1/test/output/test05-host.output +21 -0
  107. petit_log_crunchtools-3.1.1/test/output/test05-mgraph.output +15 -0
  108. petit_log_crunchtools-3.1.1/test/output/test05-mograph.output +13 -0
  109. petit_log_crunchtools-3.1.1/test/output/test05-sgraph.output +14 -0
  110. petit_log_crunchtools-3.1.1/test/output/test05-wordcount.output +827 -0
  111. petit_log_crunchtools-3.1.1/test/output/test05-ygraph.output +13 -0
  112. petit_log_crunchtools-3.1.1/test/output/test06-daemon.output +64 -0
  113. petit_log_crunchtools-3.1.1/test/output/test06-dgraph.output +14 -0
  114. petit_log_crunchtools-3.1.1/test/output/test06-hash-fingerprint.output +16 -0
  115. petit_log_crunchtools-3.1.1/test/output/test06-hash-nofilter.output +969 -0
  116. petit_log_crunchtools-3.1.1/test/output/test06-hash-nosample.output +747 -0
  117. petit_log_crunchtools-3.1.1/test/output/test06-hash.output +747 -0
  118. petit_log_crunchtools-3.1.1/test/output/test06-hgraph.output +13 -0
  119. petit_log_crunchtools-3.1.1/test/output/test06-host.output +22 -0
  120. petit_log_crunchtools-3.1.1/test/output/test06-mgraph.output +15 -0
  121. petit_log_crunchtools-3.1.1/test/output/test06-mograph.output +13 -0
  122. petit_log_crunchtools-3.1.1/test/output/test06-sgraph.output +14 -0
  123. petit_log_crunchtools-3.1.1/test/output/test06-wordcount.output +1820 -0
  124. petit_log_crunchtools-3.1.1/test/output/test06-ygraph.output +13 -0
  125. petit_log_crunchtools-3.1.1/test/output/test07-daemon.output +1 -0
  126. petit_log_crunchtools-3.1.1/test/output/test07-dgraph.output +13 -0
  127. petit_log_crunchtools-3.1.1/test/output/test07-hash-fingerprint.output +7 -0
  128. petit_log_crunchtools-3.1.1/test/output/test07-hash-nofilter.output +494 -0
  129. petit_log_crunchtools-3.1.1/test/output/test07-hash-nosample.output +7 -0
  130. petit_log_crunchtools-3.1.1/test/output/test07-hash.output +7 -0
  131. petit_log_crunchtools-3.1.1/test/output/test07-hgraph.output +14 -0
  132. petit_log_crunchtools-3.1.1/test/output/test07-host.output +1 -0
  133. petit_log_crunchtools-3.1.1/test/output/test07-mgraph.output +13 -0
  134. petit_log_crunchtools-3.1.1/test/output/test07-mograph.output +13 -0
  135. petit_log_crunchtools-3.1.1/test/output/test07-sgraph.output +13 -0
  136. petit_log_crunchtools-3.1.1/test/output/test07-wordcount.output +50 -0
  137. petit_log_crunchtools-3.1.1/test/output/test07-ygraph.output +13 -0
  138. petit_log_crunchtools-3.1.1/test/output/test08-daemon.output +1 -0
  139. petit_log_crunchtools-3.1.1/test/output/test08-dgraph.output +13 -0
  140. petit_log_crunchtools-3.1.1/test/output/test08-hash-fingerprint.output +8 -0
  141. petit_log_crunchtools-3.1.1/test/output/test08-hash-nofilter.output +1494 -0
  142. petit_log_crunchtools-3.1.1/test/output/test08-hash-nosample.output +8 -0
  143. petit_log_crunchtools-3.1.1/test/output/test08-hash.output +8 -0
  144. petit_log_crunchtools-3.1.1/test/output/test08-hgraph.output +14 -0
  145. petit_log_crunchtools-3.1.1/test/output/test08-host.output +13 -0
  146. petit_log_crunchtools-3.1.1/test/output/test08-mgraph.output +13 -0
  147. petit_log_crunchtools-3.1.1/test/output/test08-mograph.output +13 -0
  148. petit_log_crunchtools-3.1.1/test/output/test08-sgraph.output +15 -0
  149. petit_log_crunchtools-3.1.1/test/output/test08-wordcount.output +30 -0
  150. petit_log_crunchtools-3.1.1/test/output/test08-ygraph.output +13 -0
  151. petit_log_crunchtools-3.1.1/test/output/test09-daemon.output +1 -0
  152. petit_log_crunchtools-3.1.1/test/output/test09-dgraph.output +14 -0
  153. petit_log_crunchtools-3.1.1/test/output/test09-hash-fingerprint.output +18 -0
  154. petit_log_crunchtools-3.1.1/test/output/test09-hash-nofilter.output +105 -0
  155. petit_log_crunchtools-3.1.1/test/output/test09-hash-nosample.output +18 -0
  156. petit_log_crunchtools-3.1.1/test/output/test09-hash.output +18 -0
  157. petit_log_crunchtools-3.1.1/test/output/test09-hgraph.output +14 -0
  158. petit_log_crunchtools-3.1.1/test/output/test09-host.output +1 -0
  159. petit_log_crunchtools-3.1.1/test/output/test09-mgraph.output +14 -0
  160. petit_log_crunchtools-3.1.1/test/output/test09-mograph.output +13 -0
  161. petit_log_crunchtools-3.1.1/test/output/test09-sgraph.output +13 -0
  162. petit_log_crunchtools-3.1.1/test/output/test09-wordcount.output +59 -0
  163. petit_log_crunchtools-3.1.1/test/output/test09-ygraph.output +13 -0
  164. petit_log_crunchtools-3.1.1/test/output/test10-daemon.output +13 -0
  165. petit_log_crunchtools-3.1.1/test/output/test10-dgraph.output +13 -0
  166. petit_log_crunchtools-3.1.1/test/output/test10-hash-fingerprint.output +139 -0
  167. petit_log_crunchtools-3.1.1/test/output/test10-hash-nofilter.output +486 -0
  168. petit_log_crunchtools-3.1.1/test/output/test10-hash-nosample.output +428 -0
  169. petit_log_crunchtools-3.1.1/test/output/test10-hash.output +428 -0
  170. petit_log_crunchtools-3.1.1/test/output/test10-hgraph.output +14 -0
  171. petit_log_crunchtools-3.1.1/test/output/test10-host.output +1 -0
  172. petit_log_crunchtools-3.1.1/test/output/test10-mgraph.output +13 -0
  173. petit_log_crunchtools-3.1.1/test/output/test10-mograph.output +13 -0
  174. petit_log_crunchtools-3.1.1/test/output/test10-sgraph.output +14 -0
  175. petit_log_crunchtools-3.1.1/test/output/test10-wordcount.output +1157 -0
  176. petit_log_crunchtools-3.1.1/test/output/test10-ygraph.output +13 -0
  177. petit_log_crunchtools-3.1.1/test/output/test11-daemon.output +2 -0
  178. petit_log_crunchtools-3.1.1/test/output/test11-dgraph.output +14 -0
  179. petit_log_crunchtools-3.1.1/test/output/test11-hash-fingerprint.output +4 -0
  180. petit_log_crunchtools-3.1.1/test/output/test11-hash-nofilter.output +14 -0
  181. petit_log_crunchtools-3.1.1/test/output/test11-hash-nosample.output +4 -0
  182. petit_log_crunchtools-3.1.1/test/output/test11-hash.output +4 -0
  183. petit_log_crunchtools-3.1.1/test/output/test11-hgraph.output +13 -0
  184. petit_log_crunchtools-3.1.1/test/output/test11-host.output +2 -0
  185. petit_log_crunchtools-3.1.1/test/output/test11-mgraph.output +13 -0
  186. petit_log_crunchtools-3.1.1/test/output/test11-mograph.output +13 -0
  187. petit_log_crunchtools-3.1.1/test/output/test11-sgraph.output +13 -0
  188. petit_log_crunchtools-3.1.1/test/output/test11-wordcount.output +16 -0
  189. petit_log_crunchtools-3.1.1/test/output/test11-ygraph.output +13 -0
  190. petit_log_crunchtools-3.1.1/test/output/test12-daemon.output +1 -0
  191. petit_log_crunchtools-3.1.1/test/output/test12-dgraph.output +15 -0
  192. petit_log_crunchtools-3.1.1/test/output/test12-hash-fingerprint.output +30 -0
  193. petit_log_crunchtools-3.1.1/test/output/test12-hash-nofilter.output +57 -0
  194. petit_log_crunchtools-3.1.1/test/output/test12-hash-nosample.output +30 -0
  195. petit_log_crunchtools-3.1.1/test/output/test12-hash.output +30 -0
  196. petit_log_crunchtools-3.1.1/test/output/test12-hgraph.output +15 -0
  197. petit_log_crunchtools-3.1.1/test/output/test12-host.output +1 -0
  198. petit_log_crunchtools-3.1.1/test/output/test12-mgraph.output +13 -0
  199. petit_log_crunchtools-3.1.1/test/output/test12-mograph.output +13 -0
  200. petit_log_crunchtools-3.1.1/test/output/test12-sgraph.output +14 -0
  201. petit_log_crunchtools-3.1.1/test/output/test12-wordcount.output +90 -0
  202. petit_log_crunchtools-3.1.1/test/output/test12-ygraph.output +13 -0
  203. petit_log_crunchtools-3.1.1/test/test_api.py +367 -0
  204. petit_log_crunchtools-3.1.1/test/test_cli.py +129 -0
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ dist/
5
+ build/lib/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .gourmand-cache/
11
+ *.tmp
@@ -0,0 +1,2 @@
1
+ Current
2
+ Scott McCarty <scott.mccarty@gmail.com>
@@ -0,0 +1,304 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [3.1.1] - 2026-09-20
11
+
12
+ ### Fixed
13
+ - The 3.1.0 PyPI upload was rejected (trusted publisher was registered as a
14
+ new-project pending publisher instead of on the existing project's
15
+ Publishing settings). While fixing this on PyPI, the distribution name
16
+ changed to `petit-log-crunchtools`, matching the naming convention
17
+ already used elsewhere in the crunchtools fleet (`gatehouse-crunchtools`,
18
+ `mcp-gemini-crunchtools`). `petit --version` now looks up the installed
19
+ package under the new name; it would otherwise report "unknown" once
20
+ installed from PyPI.
21
+
22
+ ## [3.1.0] - 2026-09-20
23
+
24
+ ### Changed
25
+ - Relicensed from GPL-3.0-or-later to AGPL-3.0-or-later, per the
26
+ [crunchtools constitution](https://github.com/crunchtools/constitution).
27
+ Scott McCarty is the sole copyright holder.
28
+ - Raised the minimum supported Python from 3.9 to 3.11, matching the
29
+ constitution's CLI Tool profile.
30
+ - Rewrote the CLI argument parser from `optparse` to `argparse` (profile
31
+ mandates argparse; `optparse` is legacy stdlib). Every flag, default, and
32
+ the `--help` text are unchanged; the mode dispatch no longer uses `eval()`.
33
+ - Added type annotations across the library so `mypy --strict` passes with
34
+ zero errors.
35
+ - Converted `CHANGELOG` (RPM-style) to `CHANGELOG.md` (Keep a Changelog).
36
+
37
+ ### Added
38
+ - `.github/workflows/`: CI (lint, mypy, pytest on 3.11/3.12, Gourmand,
39
+ container build, constitution validation), a weekly security scan (CVE
40
+ audit + CodeQL), dual-registry container publishing (Quay.io + GHCR), and
41
+ PyPI trusted publishing on release tags.
42
+ - `Containerfile` on the Hummingbird multi-stage build pattern.
43
+ - `.specify/memory/constitution.md` declaring the CLI Tool profile.
44
+ - `gourmand.toml` / `gourmand-exceptions.toml`.
45
+ - `.github/dependabot.yml` for the `uv` and `github-actions` ecosystems.
46
+ - `uv.lock`, committed per constitution XV.
47
+ - `test/test_cli.py`: CLI integration tests covering the exit code contract
48
+ (0/1/2) and byte-for-byte output regression against the existing
49
+ `test/data`/`test/output` fixtures.
50
+
51
+ ### Fixed
52
+ - `petit --version` printed a hardcoded `2.0.0` since the 2.0.0 release; it
53
+ now reports the installed package version.
54
+
55
+ ### Removed
56
+ - The legacy `Makefile`, `build/` (rpm/deb/tar/distutils scripts), and
57
+ `distribute/` directories — superseded by `uv build` + CI.
58
+ - `src/petit/ScriptLog.py`: dead code, unreferenced by the package and
59
+ unimportable under Python 3 (`import sha`, a Python 2-only module) since
60
+ the 2.0.0 port.
61
+ - `test/test.sh`: superseded by `test/test_cli.py`.
62
+
63
+ ## [3.0.0] - 2026-09-19
64
+
65
+ ### Changed
66
+ - **BREAKING**: the import package is now `petit`, not `crunchtools`. Update
67
+ `from crunchtools import hash_text` to `from petit import hash_text`.
68
+ - **BREAKING**: the PyPI distribution is now `petit-log`, not `crunchtools`.
69
+ `crunchtools` was this project's brand, not this tool's name — spending it
70
+ on one log analyser left nothing for anything else that ships under it,
71
+ and meant the repo, the distribution, the import and the command were
72
+ four different words for one program. `petit` alone was unavailable on
73
+ PyPI (a protein engineering toolkit holds it), hence `petit-log`.
74
+ - The repository moved to `github.com/crunchtools/petit`.
75
+ - The `petit` command and every flag are unchanged, as is the library API
76
+ beyond the import path: `hash_text`, `analyze_text`, `detect_format`,
77
+ `Group`, `Analysis`, and the `PetitError` hierarchy all behave exactly as
78
+ in 2.2.0.
79
+ - `crunchtools` 2.1.0 remains on PyPI and is not superseded by an upload;
80
+ the name is being kept for a future package under that brand.
81
+
82
+ ## [2.2.0] - 2026-09-19
83
+
84
+ ### Changed
85
+ - Made driver selection deterministic. `select()` drew its sample lines
86
+ with `random.choice()`, so the driver — and therefore the entire result —
87
+ was a function of the RNG as well as the input. The same bytes could
88
+ parse two different ways, or succeed on one call and raise on the next.
89
+ It now samples evenly spaced lines, which is reproducible and, because it
90
+ always looks at the head and the tail, better evidence than a random
91
+ draw.
92
+ - A line the selected driver cannot parse no longer aborts the run. The
93
+ driver is chosen from a sample and then applied to every line, so one
94
+ stack trace in an application log, or one prose line in mixed tool
95
+ output, used to raise `ParseError` and lose the other four hundred
96
+ lines. It now falls back to `RawEntry` and reports `Analysis.degraded`.
97
+ Pass `strict=True` for the old behaviour.
98
+ - Samples are now the original lines, byte for byte. They were rebuilt
99
+ from parsed fields, which invented data: formats carrying no timestamp
100
+ were rendered with a placeholder `01 01 01:01:01 # #` envelope they
101
+ never had.
102
+ - `SecureLogHash` no longer mutates the log it is fingerprinting. `fill()`
103
+ assigned its generalised form back onto each entry, so hashing a secure
104
+ log destroyed it for every later reader — the user name and source
105
+ address, the only reason to read a sample, were gone. The rules now
106
+ build the key from a local copy.
107
+
108
+ ### Fixed
109
+ - Fixed `select()` re-counting votes across rounds. One `Tally` was reused
110
+ while the sample list grew, so round three weighed the first ten lines
111
+ three times.
112
+
113
+ ### Added
114
+ - Added `analyze_text()`, which returns the groups plus the driver used,
115
+ whether it degraded, and lines in versus lines grouped, so a caller can
116
+ account for every line rather than wonder where they went.
117
+ - Added a `driver=` argument to pin an entry class instead of detecting
118
+ one. A caller that must not have per-format vocabulary applied to its
119
+ payloads pins `RawEntry` and gets purely structural grouping. Unknown
120
+ names raise `PetitError`.
121
+ - Added a `stopwords=` argument taking regexes from the caller, used
122
+ instead of any packaged filter file. Normalisation policy belongs to
123
+ whoever reads the output: `hash.stopwords` is tuned for system logs and
124
+ deliberately aggressive, and its `[a-f]+#` rule collapses letters next
125
+ to a scrubbed number, so "bob0" and "boa0" group together. Right for
126
+ spotting a flapping daemon, wrong for a caller that needs two distinct
127
+ values to stay distinct.
128
+ - `stopwords=` entries may be `(regex, replacement)` pairs as well as bare
129
+ regexes, so a fingerprint can say what it normalised away: `<TS> host
130
+ sshd[<N>]: login from <IP>` rather than `# host sshd[#]: login from #`.
131
+ Patterns loaded from a file keep the `#` scrub character petit has
132
+ always used.
133
+ - Added `Group.sample_lines`, the 0-based position of each sample in the
134
+ input. Grouping throws the original order away, so a caller that wants
135
+ to show samples in written order rather than in group order had no way
136
+ back.
137
+ - `hash_text()` and `detect_format()` are unchanged for existing callers,
138
+ and the petit command line produces byte-identical output on the full
139
+ test corpus.
140
+
141
+ ## [2.1.0] - 2026-09-18
142
+
143
+ ### Added
144
+ - Added a library API: `crunchtools.hash_text()` and
145
+ `crunchtools.detect_format()`.
146
+ - Added `CrunchLog.from_text()` so callers can analyse a string without a
147
+ file.
148
+ - Packaged with `pyproject.toml` as the `crunchtools` distribution on
149
+ PyPI, with `petit` as a console script. The name "petit" on PyPI belongs
150
+ to an unrelated project.
151
+
152
+ ### Fixed
153
+ - Fixed an infinite loop in `select()`: a buffer no driver claimed (blank
154
+ lines, for instance) spun forever and grew its sample list on every
155
+ pass. Bounded to `MAX_SELECT_ROUNDS` with a fall back to `RawEntry`.
156
+ - Fixed a missing comma in the fingerprint prefix list that joined two
157
+ paths into one, so `/opt` was never actually searched.
158
+ - Made 7 regex literals raw (`SyntaxWarning` today, `SyntaxError` on a
159
+ future Python) and escaped a literal `[` in a character class.
160
+ - Fixed #16: an unreadable or missing file escaped as a `PermissionError`
161
+ traceback. It now raises `DataFileError`, which the CLI reports as
162
+ `petit: cannot read <path>: Permission denied` and exits 1. Reported by
163
+ Pablo Iranzo Gomez in 2022.
164
+ - The petit command line is unchanged: `--hash`, `--daemon`, `--host` and
165
+ `--wordcount` all behave exactly as before.
166
+
167
+ ### Removed
168
+ - Removed all 13 `sys.exit()` calls from library code; they raise
169
+ `PetitError` subclasses now, and only the CLI turns those into an exit
170
+ status.
171
+ - Removed `eval()` from the driver-detection path; `entry_types` holds the
172
+ classes rather than their names. Auto-registration of new drivers is
173
+ unchanged.
174
+ - Dropped the `sys.path` and `warnings.simplefilter` side effects from
175
+ package import; a library should not mutate global state when it is
176
+ imported.
177
+
178
+ ### Changed
179
+ - Fingerprints and stopwords now ship inside the package and resolve
180
+ through `importlib.resources`, so a pip install has its data. They were
181
+ only ever installed to `/var/lib/petit` by the distro packaging, which
182
+ meant filtering silently did nothing anywhere else.
183
+
184
+ ## [2.0.0] - 2022-10-13
185
+
186
+ ### Changed
187
+ - Ported to Python 3.
188
+ - Cleaned up to PEP 8 and added the `Tally` class to simplify
189
+ driver-selection logic (committed 2011-04-16, the day after the 1.1.1
190
+ tag, so it waited here).
191
+ - Reorganised the directory structure.
192
+ - (Recorded retroactively in 2026 — this release shipped without a
193
+ changelog entry at the time.)
194
+
195
+ ### Fixed
196
+ - Fixed Test 12; the suite passes again.
197
+
198
+ ### Not merged during this period
199
+ Proposed but not merged, so none of it is in the code. Recorded because
200
+ the history is otherwise invisible; all four were opened by Pablo Iranzo
201
+ Gomez (iranzo) in Oct 2022 and closed unmerged in Nov 2024:
202
+ - #12 packaging for PyPI. Published independently as `petitlog` 2.0.0.post3
203
+ on 2022-10-17 — https://pypi.org/project/petitlog/ — which is why that
204
+ name is taken. It is this project, credited to Scott McCarty, and is
205
+ unrelated to the `crunchtools` distribution published in 2026.
206
+ - #14 GitHub Actions to help with release tagging.
207
+ - #15 pre-commit configuration, applied across the code.
208
+ - #17 permission check in CrunchLog.py to avoid a traceback on unreadable
209
+ files (closes #16).
210
+
211
+ ## [1.1.1] - 2011-04-15
212
+
213
+ ### Added
214
+ - Added `re.escape` to variable based regex.
215
+ - Added debugging output for graph.
216
+ - Added patch for bug with determining month.
217
+ - Added empty log data test, new test output for broken apache error log,
218
+ and new test files.
219
+ - Added path for logs with no data.
220
+ - Added try/catch for interspersed wrong data problem.
221
+ - Added better documentation for rsyslog.
222
+
223
+ ### Fixed
224
+ - Fixed index bug in syslog entry and rsyslog.
225
+
226
+ ### Changed
227
+ - Updated outputs for new patch and year change.
228
+ - Updated description of tests.
229
+
230
+ ## [1.1.0] - 2010-11-09
231
+
232
+ ### Changed
233
+ - Finished conversion of crunchtools to a module.
234
+ - Passes all tests again.
235
+
236
+ ## [1.0.4] - 2010-11-08
237
+
238
+ ### Fixed
239
+ - Updated version because of a problem with rpdb2.
240
+
241
+ ## [1.0.3] - 2010-06-25
242
+
243
+ ### Fixed
244
+ - Patched to allow mixed precision when Ubuntu 8.04 logs to an Ubuntu
245
+ 10.04 server with high precision.
246
+
247
+ ## Pre-1.0 history
248
+
249
+ These predate version numbering — the original changelog recorded them by
250
+ date only, with no corresponding git tag or release number. Dates are
251
+ preserved here rather than assigned invented version numbers.
252
+
253
+ ### 2010-06-24
254
+ - Added support for rsyslogd precision time format.
255
+ - Added fingerprints for Ubuntu 10.04.
256
+ - Added NAME section to man page.
257
+
258
+ ### 2010-02-27
259
+ - Added apache error log support and tests.
260
+ - Added man page.
261
+ - Added fingerprints for Ubuntu 9.04.
262
+
263
+ ### 2010-02-12
264
+ - Moved a bunch of code into the `select` function of the Log object so
265
+ that it can now randomly sample ten entries over and over until it
266
+ determines what kind of file has been opened.
267
+ - Now passes all regression tests, all the time.
268
+
269
+ ### 2010-01-18
270
+ - Changed defaults for entries to 1900 so that time delta calculations do
271
+ not fail.
272
+ - Changed log determination logic to use multiple samples.
273
+ - Fixed bug in SecureLog processing where sample line was not being
274
+ checked for long enough line.
275
+ - Added string conversion to all known log types to resolve type bugs
276
+ casting strings and numbers.
277
+
278
+ ### 2010-01-15
279
+ - Added Linux secure log processing capabilities.
280
+ - Added month graph and year graph (syslog carries no year data, so
281
+ don't draw wrong conclusions from either).
282
+ - Added year support in code.
283
+ - Added Days graph.
284
+ - Added normalization code for better differentiation of close values,
285
+ handling most edge cases.
286
+ - Removed first sample, replaced by random sampling for log type
287
+ determination (later made deterministic in 2.2.0).
288
+ - Completely revamped date delta code using `datetime` built-in
289
+ functionality to calculate date/time ranges.
290
+ - Re-architected and redesigned graphing logic and output to better match
291
+ cacti/RRD. Kept graphing as separate classes per graph type rather than
292
+ a more "object-oriented" hierarchy — closer to report writing than
293
+ inheritance.
294
+ - Fixed documentation/help menu text.
295
+ - Fixed bug in value calculations of each bar of graph; values were
296
+ erroring low.
297
+
298
+ ### 2009-07-31
299
+ - First working version.
300
+
301
+ [Unreleased]: https://github.com/crunchtools/petit/compare/v3.1.1...HEAD
302
+ [3.1.1]: https://github.com/crunchtools/petit/releases/tag/v3.1.1
303
+ [3.1.0]: https://github.com/crunchtools/petit/releases/tag/v3.1.0
304
+ [3.0.0]: https://github.com/crunchtools/petit/releases/tag/v3.0.0