depcooldown-lite 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PyForge (https://py-forge.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: depcooldown-lite
3
+ Version: 0.1.0
4
+ Summary: Dependency cooldown check: fail CI when a pinned PyPI or npm package is newer than N days.
5
+ Author: Alessio Auretto
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/alessio1999xx-debug/depcooldown-lite
8
+ Project-URL: Repository, https://github.com/alessio1999xx-debug/depcooldown-lite
9
+ Project-URL: Pro version, https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=pypi&utm_medium=project_page&utm_campaign=depcooldown-lite
10
+ Keywords: dependency-cooldown,supply-chain-security,release-age,pypi,npm,requirements-txt,package-lock,ci,devsecops,cli,stdlib
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Security
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Dynamic: license-file
27
+
28
+ # depcooldown-lite: dependency cooldown check that fails CI when a pinned PyPI or npm package is too new
29
+
30
+ depcooldown-lite helps with a dependency cooldown for the pins you already committed: it reads a `requirements.txt` or `package-lock.json`, asks the public PyPI / npm registry when each pinned version was published, and exits `1` if any is younger than `--cooldown` days (default 7). One file, Python 3.9+ standard library only, read-only, MIT.
31
+
32
+ - Nothing to `pip install`. One file per run, no config, no state.
33
+ - Flags: `--cooldown`, `--json`, `--version`.
34
+
35
+ Need `poetry.lock` / `uv.lock` / pnpm / Yarn, a suggested older version, or an offline cache? That is the full [DepCooldown](https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) (one-time payment, yours to keep, no subscription). A table later in this README lists what lite does and what the paid tool adds. Or get every PyForge tool, current and future, with the [All-Access Pass](https://py-forge.com/pass?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) ($99, one payment).
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ curl -fsSLO https://raw.githubusercontent.com/alessio1999xx-debug/depcooldown-lite/main/depcooldown_lite.py
41
+ python3 depcooldown_lite.py --help
42
+ ```
43
+
44
+ ## Check a requirements.txt or package-lock.json for releases that are too new
45
+
46
+ ```bash
47
+ python3 depcooldown_lite.py requirements.txt
48
+ # Recorded 25 Nov 2026, Europe/Rome. Ages change as time passes.
49
+ # 2 pinned pypi packages in requirements.txt, cooldown 7 days
50
+ # OK requests==2.32.3 (909.3 days old)
51
+ # OK urllib3==2.2.3 (803.5 days old)
52
+ # OK: nothing inside the cooldown
53
+
54
+ python3 depcooldown_lite.py package-lock.json --cooldown 3
55
+ python3 depcooldown_lite.py requirements.txt --json
56
+ ```
57
+
58
+ Only exact pins are checked (`name==version` lines in requirements files, every resolved package in `package-lock.json` v1/v2/v3). Ranges like `flask>=2` are skipped. A version the registry can't confirm is shown as `UNVERIFIED` and does not fail the run.
59
+
60
+ ## Exit codes for CI
61
+
62
+ | Exit code | Meaning |
63
+ | --- | --- |
64
+ | `0` | No pinned version is younger than `--cooldown` days |
65
+ | `1` | At least one pinned version was published fewer than `--cooldown` days ago |
66
+ | `2` | Bad arguments, missing file, or a file type the lite version doesn't read |
67
+
68
+ ```yaml
69
+ # any CI: run it as a step before installing
70
+ - run: curl -fsSLO https://raw.githubusercontent.com/alessio1999xx-debug/depcooldown-lite/main/depcooldown_lite.py && python3 depcooldown_lite.py requirements.txt
71
+ ```
72
+
73
+ ## Already using pip --uploaded-prior-to or uv exclude-newer?
74
+
75
+ New pip versions have `--uploaded-prior-to` and uv has `exclude-newer`, which stop the resolver from picking very new releases at install time. If those cover you, use them. depcooldown-lite is for checking the pins you **already** committed, in Python and npm projects alike, with a plain exit code.
76
+
77
+ ## depcooldown-lite vs DepCooldown
78
+
79
+ depcooldown-lite checks one `requirements*.txt` or `package-lock.json` against the live registry and tells you which pins are too new. That's it.
80
+
81
+ | Capability | Lite (free) | Paid DepCooldown |
82
+ | --- | --- | --- |
83
+ | Files | One `requirements*.txt` or `package-lock.json` | Also `pyproject.toml`, `poetry.lock`, `uv.lock`, `npm-shrinkwrap.json`, `pnpm-lock.yaml` and `yarn.lock` |
84
+ | Live registry age check, configurable `--cooldown` | Yes | Yes |
85
+ | Suggest an older version already outside the cooldown | No | Yes |
86
+ | `--diff-base` for brand-new deps and major version jumps | No | Yes |
87
+ | Offline mode (local JSON cache of registry dates) | No | Yes |
88
+ | Reviewed, expiring allow-list overrides | No | Yes (`--allow`, `--allow-file`) |
89
+ | Output | Plain text or `--json` | Text plus a Markdown CI summary (`--markdown-summary`) |
90
+
91
+ One-time payment, yours to keep. No subscription. Full tool: [DepCooldown](https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite). Or get every PyForge tool, current and future, with the [All-Access Pass](https://py-forge.com/pass?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) ($99, one payment).
92
+
93
+ See also [pthguard-lite](https://github.com/alessio1999xx-debug/pthguard-lite), which scans a virtualenv for `.pth` startup backdoors.
94
+
95
+ ## Tests
96
+
97
+ ```bash
98
+ python3 test_depcooldown_lite.py
99
+ ```
100
+
101
+ The tests are offline: registry answers are faked.
102
+
103
+ ## More free tools from the same author
104
+
105
+ - [agentconfig-audit-lite](https://github.com/alessio1999xx-debug/agentconfig-audit-lite) — Audit MCP config for secrets: plaintext tokens and unpinned npx/uvx servers in `.mcp.json` and `CLAUDE.md`.
106
+ - [agenttrail-scrub-lite](https://github.com/alessio1999xx-debug/agenttrail-scrub-lite) — Claude Code secret scanner: find API keys and tokens leaked in AI agent transcripts.
107
+ - [cronpulse-lite](https://github.com/alessio1999xx-debug/cronpulse-lite) — Cron job monitoring in one Python file: alerts to Slack/Discord/webhook on failure or hang.
108
+ - [homelab-doctor-lite](https://github.com/alessio1999xx-debug/homelab-doctor-lite) — Read-only homelab health check: stale images, exposed ports, expiring certs, silent cron, disk.
109
+ - [imagenudge-lite](https://github.com/alessio1999xx-debug/imagenudge-lite) — Docker image update checker: find running containers with a newer image (digest or tag).
110
+ - [pthguard-lite](https://github.com/alessio1999xx-debug/pthguard-lite) — Scan Python site-packages for malicious `.pth` files and startup backdoors.
111
+ - [pulseping-lite](https://github.com/alessio1999xx-debug/pulseping-lite) — Check SSL certificate expiry and URL/port uptime from cron.
112
+ - [secenv-lite](https://github.com/alessio1999xx-debug/secenv-lite) — Find `.env` files committed to git or missing from `.gitignore`, plus obvious API keys inside.
113
+
114
+ ## License
115
+
116
+ MIT (this lite version). The full DepCooldown is sold separately under its own license.
@@ -0,0 +1,89 @@
1
+ # depcooldown-lite: dependency cooldown check that fails CI when a pinned PyPI or npm package is too new
2
+
3
+ depcooldown-lite helps with a dependency cooldown for the pins you already committed: it reads a `requirements.txt` or `package-lock.json`, asks the public PyPI / npm registry when each pinned version was published, and exits `1` if any is younger than `--cooldown` days (default 7). One file, Python 3.9+ standard library only, read-only, MIT.
4
+
5
+ - Nothing to `pip install`. One file per run, no config, no state.
6
+ - Flags: `--cooldown`, `--json`, `--version`.
7
+
8
+ Need `poetry.lock` / `uv.lock` / pnpm / Yarn, a suggested older version, or an offline cache? That is the full [DepCooldown](https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) (one-time payment, yours to keep, no subscription). A table later in this README lists what lite does and what the paid tool adds. Or get every PyForge tool, current and future, with the [All-Access Pass](https://py-forge.com/pass?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) ($99, one payment).
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ curl -fsSLO https://raw.githubusercontent.com/alessio1999xx-debug/depcooldown-lite/main/depcooldown_lite.py
14
+ python3 depcooldown_lite.py --help
15
+ ```
16
+
17
+ ## Check a requirements.txt or package-lock.json for releases that are too new
18
+
19
+ ```bash
20
+ python3 depcooldown_lite.py requirements.txt
21
+ # Recorded 25 Nov 2026, Europe/Rome. Ages change as time passes.
22
+ # 2 pinned pypi packages in requirements.txt, cooldown 7 days
23
+ # OK requests==2.32.3 (909.3 days old)
24
+ # OK urllib3==2.2.3 (803.5 days old)
25
+ # OK: nothing inside the cooldown
26
+
27
+ python3 depcooldown_lite.py package-lock.json --cooldown 3
28
+ python3 depcooldown_lite.py requirements.txt --json
29
+ ```
30
+
31
+ Only exact pins are checked (`name==version` lines in requirements files, every resolved package in `package-lock.json` v1/v2/v3). Ranges like `flask>=2` are skipped. A version the registry can't confirm is shown as `UNVERIFIED` and does not fail the run.
32
+
33
+ ## Exit codes for CI
34
+
35
+ | Exit code | Meaning |
36
+ | --- | --- |
37
+ | `0` | No pinned version is younger than `--cooldown` days |
38
+ | `1` | At least one pinned version was published fewer than `--cooldown` days ago |
39
+ | `2` | Bad arguments, missing file, or a file type the lite version doesn't read |
40
+
41
+ ```yaml
42
+ # any CI: run it as a step before installing
43
+ - run: curl -fsSLO https://raw.githubusercontent.com/alessio1999xx-debug/depcooldown-lite/main/depcooldown_lite.py && python3 depcooldown_lite.py requirements.txt
44
+ ```
45
+
46
+ ## Already using pip --uploaded-prior-to or uv exclude-newer?
47
+
48
+ New pip versions have `--uploaded-prior-to` and uv has `exclude-newer`, which stop the resolver from picking very new releases at install time. If those cover you, use them. depcooldown-lite is for checking the pins you **already** committed, in Python and npm projects alike, with a plain exit code.
49
+
50
+ ## depcooldown-lite vs DepCooldown
51
+
52
+ depcooldown-lite checks one `requirements*.txt` or `package-lock.json` against the live registry and tells you which pins are too new. That's it.
53
+
54
+ | Capability | Lite (free) | Paid DepCooldown |
55
+ | --- | --- | --- |
56
+ | Files | One `requirements*.txt` or `package-lock.json` | Also `pyproject.toml`, `poetry.lock`, `uv.lock`, `npm-shrinkwrap.json`, `pnpm-lock.yaml` and `yarn.lock` |
57
+ | Live registry age check, configurable `--cooldown` | Yes | Yes |
58
+ | Suggest an older version already outside the cooldown | No | Yes |
59
+ | `--diff-base` for brand-new deps and major version jumps | No | Yes |
60
+ | Offline mode (local JSON cache of registry dates) | No | Yes |
61
+ | Reviewed, expiring allow-list overrides | No | Yes (`--allow`, `--allow-file`) |
62
+ | Output | Plain text or `--json` | Text plus a Markdown CI summary (`--markdown-summary`) |
63
+
64
+ One-time payment, yours to keep. No subscription. Full tool: [DepCooldown](https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite). Or get every PyForge tool, current and future, with the [All-Access Pass](https://py-forge.com/pass?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) ($99, one payment).
65
+
66
+ See also [pthguard-lite](https://github.com/alessio1999xx-debug/pthguard-lite), which scans a virtualenv for `.pth` startup backdoors.
67
+
68
+ ## Tests
69
+
70
+ ```bash
71
+ python3 test_depcooldown_lite.py
72
+ ```
73
+
74
+ The tests are offline: registry answers are faked.
75
+
76
+ ## More free tools from the same author
77
+
78
+ - [agentconfig-audit-lite](https://github.com/alessio1999xx-debug/agentconfig-audit-lite) — Audit MCP config for secrets: plaintext tokens and unpinned npx/uvx servers in `.mcp.json` and `CLAUDE.md`.
79
+ - [agenttrail-scrub-lite](https://github.com/alessio1999xx-debug/agenttrail-scrub-lite) — Claude Code secret scanner: find API keys and tokens leaked in AI agent transcripts.
80
+ - [cronpulse-lite](https://github.com/alessio1999xx-debug/cronpulse-lite) — Cron job monitoring in one Python file: alerts to Slack/Discord/webhook on failure or hang.
81
+ - [homelab-doctor-lite](https://github.com/alessio1999xx-debug/homelab-doctor-lite) — Read-only homelab health check: stale images, exposed ports, expiring certs, silent cron, disk.
82
+ - [imagenudge-lite](https://github.com/alessio1999xx-debug/imagenudge-lite) — Docker image update checker: find running containers with a newer image (digest or tag).
83
+ - [pthguard-lite](https://github.com/alessio1999xx-debug/pthguard-lite) — Scan Python site-packages for malicious `.pth` files and startup backdoors.
84
+ - [pulseping-lite](https://github.com/alessio1999xx-debug/pulseping-lite) — Check SSL certificate expiry and URL/port uptime from cron.
85
+ - [secenv-lite](https://github.com/alessio1999xx-debug/secenv-lite) — Find `.env` files committed to git or missing from `.gitignore`, plus obvious API keys inside.
86
+
87
+ ## License
88
+
89
+ MIT (this lite version). The full DepCooldown is sold separately under its own license.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: depcooldown-lite
3
+ Version: 0.1.0
4
+ Summary: Dependency cooldown check: fail CI when a pinned PyPI or npm package is newer than N days.
5
+ Author: Alessio Auretto
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/alessio1999xx-debug/depcooldown-lite
8
+ Project-URL: Repository, https://github.com/alessio1999xx-debug/depcooldown-lite
9
+ Project-URL: Pro version, https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=pypi&utm_medium=project_page&utm_campaign=depcooldown-lite
10
+ Keywords: dependency-cooldown,supply-chain-security,release-age,pypi,npm,requirements-txt,package-lock,ci,devsecops,cli,stdlib
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Security
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Dynamic: license-file
27
+
28
+ # depcooldown-lite: dependency cooldown check that fails CI when a pinned PyPI or npm package is too new
29
+
30
+ depcooldown-lite helps with a dependency cooldown for the pins you already committed: it reads a `requirements.txt` or `package-lock.json`, asks the public PyPI / npm registry when each pinned version was published, and exits `1` if any is younger than `--cooldown` days (default 7). One file, Python 3.9+ standard library only, read-only, MIT.
31
+
32
+ - Nothing to `pip install`. One file per run, no config, no state.
33
+ - Flags: `--cooldown`, `--json`, `--version`.
34
+
35
+ Need `poetry.lock` / `uv.lock` / pnpm / Yarn, a suggested older version, or an offline cache? That is the full [DepCooldown](https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) (one-time payment, yours to keep, no subscription). A table later in this README lists what lite does and what the paid tool adds. Or get every PyForge tool, current and future, with the [All-Access Pass](https://py-forge.com/pass?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) ($99, one payment).
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ curl -fsSLO https://raw.githubusercontent.com/alessio1999xx-debug/depcooldown-lite/main/depcooldown_lite.py
41
+ python3 depcooldown_lite.py --help
42
+ ```
43
+
44
+ ## Check a requirements.txt or package-lock.json for releases that are too new
45
+
46
+ ```bash
47
+ python3 depcooldown_lite.py requirements.txt
48
+ # Recorded 25 Nov 2026, Europe/Rome. Ages change as time passes.
49
+ # 2 pinned pypi packages in requirements.txt, cooldown 7 days
50
+ # OK requests==2.32.3 (909.3 days old)
51
+ # OK urllib3==2.2.3 (803.5 days old)
52
+ # OK: nothing inside the cooldown
53
+
54
+ python3 depcooldown_lite.py package-lock.json --cooldown 3
55
+ python3 depcooldown_lite.py requirements.txt --json
56
+ ```
57
+
58
+ Only exact pins are checked (`name==version` lines in requirements files, every resolved package in `package-lock.json` v1/v2/v3). Ranges like `flask>=2` are skipped. A version the registry can't confirm is shown as `UNVERIFIED` and does not fail the run.
59
+
60
+ ## Exit codes for CI
61
+
62
+ | Exit code | Meaning |
63
+ | --- | --- |
64
+ | `0` | No pinned version is younger than `--cooldown` days |
65
+ | `1` | At least one pinned version was published fewer than `--cooldown` days ago |
66
+ | `2` | Bad arguments, missing file, or a file type the lite version doesn't read |
67
+
68
+ ```yaml
69
+ # any CI: run it as a step before installing
70
+ - run: curl -fsSLO https://raw.githubusercontent.com/alessio1999xx-debug/depcooldown-lite/main/depcooldown_lite.py && python3 depcooldown_lite.py requirements.txt
71
+ ```
72
+
73
+ ## Already using pip --uploaded-prior-to or uv exclude-newer?
74
+
75
+ New pip versions have `--uploaded-prior-to` and uv has `exclude-newer`, which stop the resolver from picking very new releases at install time. If those cover you, use them. depcooldown-lite is for checking the pins you **already** committed, in Python and npm projects alike, with a plain exit code.
76
+
77
+ ## depcooldown-lite vs DepCooldown
78
+
79
+ depcooldown-lite checks one `requirements*.txt` or `package-lock.json` against the live registry and tells you which pins are too new. That's it.
80
+
81
+ | Capability | Lite (free) | Paid DepCooldown |
82
+ | --- | --- | --- |
83
+ | Files | One `requirements*.txt` or `package-lock.json` | Also `pyproject.toml`, `poetry.lock`, `uv.lock`, `npm-shrinkwrap.json`, `pnpm-lock.yaml` and `yarn.lock` |
84
+ | Live registry age check, configurable `--cooldown` | Yes | Yes |
85
+ | Suggest an older version already outside the cooldown | No | Yes |
86
+ | `--diff-base` for brand-new deps and major version jumps | No | Yes |
87
+ | Offline mode (local JSON cache of registry dates) | No | Yes |
88
+ | Reviewed, expiring allow-list overrides | No | Yes (`--allow`, `--allow-file`) |
89
+ | Output | Plain text or `--json` | Text plus a Markdown CI summary (`--markdown-summary`) |
90
+
91
+ One-time payment, yours to keep. No subscription. Full tool: [DepCooldown](https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite). Or get every PyForge tool, current and future, with the [All-Access Pass](https://py-forge.com/pass?utm_source=github&utm_medium=readme&utm_campaign=depcooldown-lite) ($99, one payment).
92
+
93
+ See also [pthguard-lite](https://github.com/alessio1999xx-debug/pthguard-lite), which scans a virtualenv for `.pth` startup backdoors.
94
+
95
+ ## Tests
96
+
97
+ ```bash
98
+ python3 test_depcooldown_lite.py
99
+ ```
100
+
101
+ The tests are offline: registry answers are faked.
102
+
103
+ ## More free tools from the same author
104
+
105
+ - [agentconfig-audit-lite](https://github.com/alessio1999xx-debug/agentconfig-audit-lite) — Audit MCP config for secrets: plaintext tokens and unpinned npx/uvx servers in `.mcp.json` and `CLAUDE.md`.
106
+ - [agenttrail-scrub-lite](https://github.com/alessio1999xx-debug/agenttrail-scrub-lite) — Claude Code secret scanner: find API keys and tokens leaked in AI agent transcripts.
107
+ - [cronpulse-lite](https://github.com/alessio1999xx-debug/cronpulse-lite) — Cron job monitoring in one Python file: alerts to Slack/Discord/webhook on failure or hang.
108
+ - [homelab-doctor-lite](https://github.com/alessio1999xx-debug/homelab-doctor-lite) — Read-only homelab health check: stale images, exposed ports, expiring certs, silent cron, disk.
109
+ - [imagenudge-lite](https://github.com/alessio1999xx-debug/imagenudge-lite) — Docker image update checker: find running containers with a newer image (digest or tag).
110
+ - [pthguard-lite](https://github.com/alessio1999xx-debug/pthguard-lite) — Scan Python site-packages for malicious `.pth` files and startup backdoors.
111
+ - [pulseping-lite](https://github.com/alessio1999xx-debug/pulseping-lite) — Check SSL certificate expiry and URL/port uptime from cron.
112
+ - [secenv-lite](https://github.com/alessio1999xx-debug/secenv-lite) — Find `.env` files committed to git or missing from `.gitignore`, plus obvious API keys inside.
113
+
114
+ ## License
115
+
116
+ MIT (this lite version). The full DepCooldown is sold separately under its own license.
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ depcooldown_lite.py
4
+ pyproject.toml
5
+ depcooldown_lite.egg-info/PKG-INFO
6
+ depcooldown_lite.egg-info/SOURCES.txt
7
+ depcooldown_lite.egg-info/dependency_links.txt
8
+ depcooldown_lite.egg-info/entry_points.txt
9
+ depcooldown_lite.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ depcooldown-lite = depcooldown_lite:main
@@ -0,0 +1 @@
1
+ depcooldown_lite
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env python3
2
+ """depcooldown-lite: flag pinned PyPI/npm dependencies released too recently.
3
+
4
+ Reads one requirements.txt or package-lock.json, asks the public PyPI / npm
5
+ registry when each pinned version was published, and fails (exit 1) if any of
6
+ them is younger than the cooldown (default 7 days). Read-only, stdlib-only.
7
+
8
+ MIT License. Full version (lockfile diffing, safe-version suggestions, offline
9
+ cache, uv.lock / poetry.lock / pyproject.toml, Markdown CI summary):
10
+ https://py-forge.com/products/depcooldown-dependency-release-age-gate
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import argparse
16
+ import datetime
17
+ import json
18
+ import os
19
+ import re
20
+ import sys
21
+ import urllib.error
22
+ import urllib.parse
23
+ import urllib.request
24
+ from typing import Callable, Dict, List, Optional, Tuple
25
+
26
+ __version__ = "0.1.0"
27
+
28
+ PYPI_URL = "https://pypi.org/pypi/{package}/json"
29
+ NPM_URL = "https://registry.npmjs.org/{package}"
30
+
31
+ EXIT_OK, EXIT_FAIL, EXIT_USAGE = 0, 1, 2
32
+
33
+
34
+ def parse_iso(ts: str) -> datetime.datetime:
35
+ cleaned = ts.strip().replace("Z", "+00:00")
36
+ cleaned = re.sub(r"(\.\d{6})\d+", r"\1", cleaned)
37
+ try:
38
+ dt = datetime.datetime.fromisoformat(cleaned)
39
+ except ValueError:
40
+ dt = datetime.datetime.strptime(cleaned[:19], "%Y-%m-%dT%H:%M:%S")
41
+ if dt.tzinfo is None:
42
+ dt = dt.replace(tzinfo=datetime.timezone.utc)
43
+ return dt
44
+
45
+
46
+ def parse_requirements(content: str) -> Dict[str, str]:
47
+ """Return {name: version} for strictly pinned name==version lines."""
48
+ pinned: Dict[str, str] = {}
49
+ for raw in content.splitlines():
50
+ line = raw.split(" #", 1)[0].split(";", 1)[0].strip()
51
+ if not line or line.startswith(("#", "-")):
52
+ continue
53
+ m = re.match(r"^([A-Za-z0-9_.\-]+)(?:\[[^\]]*\])?\s*==\s*([A-Za-z0-9_.\-+!]+)$", line)
54
+ if m:
55
+ pinned[m.group(1).lower().replace("_", "-")] = m.group(2)
56
+ return pinned
57
+
58
+
59
+ def parse_package_lock(content: str) -> Dict[str, str]:
60
+ """Return {name: version} from an npm package-lock.json (v1, v2 or v3)."""
61
+ data = json.loads(content)
62
+ pinned: Dict[str, str] = {}
63
+ packages = data.get("packages")
64
+ if isinstance(packages, dict):
65
+ for path, meta in packages.items():
66
+ if not path or not isinstance(meta, dict) or meta.get("link"):
67
+ continue
68
+ name = meta.get("name") or path.split("node_modules/")[-1]
69
+ if meta.get("version"):
70
+ pinned[name] = meta["version"]
71
+ elif isinstance(data.get("dependencies"), dict):
72
+ for name, meta in data["dependencies"].items():
73
+ if isinstance(meta, dict) and meta.get("version"):
74
+ pinned[name] = meta["version"]
75
+ return pinned
76
+
77
+
78
+ def load_pins(path: str) -> Tuple[str, Dict[str, str]]:
79
+ base = os.path.basename(path).lower()
80
+ with open(path, "r", encoding="utf-8") as fh:
81
+ content = fh.read()
82
+ if base in ("package-lock.json", "npm-shrinkwrap.json"):
83
+ return "npm", parse_package_lock(content)
84
+ if base.endswith(".txt"):
85
+ return "pypi", parse_requirements(content)
86
+ raise ValueError(
87
+ "depcooldown-lite reads requirements*.txt or package-lock.json only "
88
+ "(uv.lock, poetry.lock and pyproject.toml are in the full DepCooldown)."
89
+ )
90
+
91
+
92
+ def fetch_upload_time(ecosystem: str, package: str, version: str, timeout: float = 10.0) -> Optional[str]:
93
+ """Return the ISO publish time of package==version, or None if unknown."""
94
+ url = (NPM_URL if ecosystem == "npm" else PYPI_URL).format(package=urllib.parse.quote(package, safe="@"))
95
+ req = urllib.request.Request(url, headers={"User-Agent": "depcooldown-lite/" + __version__, "Accept": "application/json"})
96
+ try:
97
+ with urllib.request.urlopen(req, timeout=timeout) as resp:
98
+ data = json.loads(resp.read().decode("utf-8"))
99
+ except (urllib.error.URLError, OSError, ValueError) as err:
100
+ sys.stderr.write(f"warning: could not query {ecosystem} for {package}: {err}\n")
101
+ return None
102
+ if ecosystem == "npm":
103
+ return (data.get("time") or {}).get(version)
104
+ files = (data.get("releases") or {}).get(version) or []
105
+ if files:
106
+ return files[0].get("upload_time_iso_8601") or files[0].get("upload_time")
107
+ return None
108
+
109
+
110
+ def audit(pins: Dict[str, str], ecosystem: str, cooldown_days: int, now: datetime.datetime,
111
+ fetch: Callable[[str, str, str], Optional[str]]) -> List[dict]:
112
+ results = []
113
+ for name, ver in sorted(pins.items()):
114
+ ts = fetch(ecosystem, name, ver)
115
+ if ts is None:
116
+ results.append({"package": name, "version": ver, "status": "UNVERIFIED", "age_days": None})
117
+ continue
118
+ age = (now - parse_iso(ts)).total_seconds() / 86400.0
119
+ status = "FAIL" if age < cooldown_days else "OK"
120
+ results.append({"package": name, "version": ver, "status": status, "age_days": round(age, 1)})
121
+ return results
122
+
123
+
124
+ def build_parser() -> argparse.ArgumentParser:
125
+ p = argparse.ArgumentParser(
126
+ prog="depcooldown_lite.py",
127
+ description="Fail CI when a pinned PyPI/npm dependency was released fewer than N days ago.",
128
+ )
129
+ p.add_argument("file", help="requirements.txt or package-lock.json")
130
+ p.add_argument("-c", "--cooldown", type=int, default=7, help="minimum release age in days (default 7)")
131
+ p.add_argument("--json", action="store_true", help="print results as JSON")
132
+ p.add_argument("--version", action="version", version="%(prog)s " + __version__)
133
+ return p
134
+
135
+
136
+ def main(argv: Optional[List[str]] = None, fetch=fetch_upload_time, now: Optional[datetime.datetime] = None) -> int:
137
+ args = build_parser().parse_args(argv)
138
+ if args.cooldown < 0:
139
+ sys.stderr.write("error: --cooldown must be >= 0\n")
140
+ return EXIT_USAGE
141
+ try:
142
+ ecosystem, pins = load_pins(args.file)
143
+ except (OSError, ValueError) as err:
144
+ sys.stderr.write(f"error: {err}\n")
145
+ return EXIT_USAGE
146
+ now = now or datetime.datetime.now(datetime.timezone.utc)
147
+ results = audit(pins, ecosystem, args.cooldown, now, fetch)
148
+ failed = [r for r in results if r["status"] == "FAIL"]
149
+ if args.json:
150
+ print(json.dumps({"file": args.file, "ecosystem": ecosystem, "cooldown_days": args.cooldown,
151
+ "results": results, "failed": len(failed)}, indent=2))
152
+ else:
153
+ print(f"{len(pins)} pinned {ecosystem} packages in {args.file}, cooldown {args.cooldown} days")
154
+ for r in results:
155
+ age = "unknown age" if r["age_days"] is None else f"{r['age_days']} days old"
156
+ print(f" {r['status']:<10} {r['package']}=={r['version']} ({age})")
157
+ print(f"{len(failed)} package(s) younger than {args.cooldown} days" if failed else "OK: nothing inside the cooldown")
158
+ return EXIT_FAIL if failed else EXIT_OK
159
+
160
+
161
+ if __name__ == "__main__":
162
+ sys.exit(main())
@@ -0,0 +1,51 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "depcooldown-lite"
7
+ version = "0.1.0"
8
+ description = "Dependency cooldown check: fail CI when a pinned PyPI or npm package is newer than N days."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.9"
13
+ authors = [{name = "Alessio Auretto"}]
14
+ keywords = [
15
+ "dependency-cooldown",
16
+ "supply-chain-security",
17
+ "release-age",
18
+ "pypi",
19
+ "npm",
20
+ "requirements-txt",
21
+ "package-lock",
22
+ "ci",
23
+ "devsecops",
24
+ "cli",
25
+ "stdlib",
26
+ ]
27
+ classifiers = [
28
+ "Development Status :: 4 - Beta",
29
+ "Environment :: Console",
30
+ "Intended Audience :: Developers",
31
+ "Operating System :: OS Independent",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.9",
34
+ "Programming Language :: Python :: 3.10",
35
+ "Programming Language :: Python :: 3.11",
36
+ "Programming Language :: Python :: 3.12",
37
+ "Programming Language :: Python :: 3.13",
38
+ "Topic :: Security",
39
+ "Topic :: Utilities",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/alessio1999xx-debug/depcooldown-lite"
44
+ Repository = "https://github.com/alessio1999xx-debug/depcooldown-lite"
45
+ "Pro version" = "https://py-forge.com/products/depcooldown-dependency-release-age-gate?utm_source=pypi&utm_medium=project_page&utm_campaign=depcooldown-lite"
46
+
47
+ [project.scripts]
48
+ depcooldown-lite = "depcooldown_lite:main"
49
+
50
+ [tool.setuptools]
51
+ py-modules = ["depcooldown_lite"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+