warmup-ramp-planner 1.0.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.
- warmup_ramp_planner-1.0.0/LICENSE +22 -0
- warmup_ramp_planner-1.0.0/PKG-INFO +42 -0
- warmup_ramp_planner-1.0.0/README.md +29 -0
- warmup_ramp_planner-1.0.0/pyproject.toml +15 -0
- warmup_ramp_planner-1.0.0/setup.cfg +4 -0
- warmup_ramp_planner-1.0.0/tests/test_warmup.py +38 -0
- warmup_ramp_planner-1.0.0/warmup_ramp/__init__.py +0 -0
- warmup_ramp_planner-1.0.0/warmup_ramp/__main__.py +3 -0
- warmup_ramp_planner-1.0.0/warmup_ramp/cli.py +47 -0
- warmup_ramp_planner-1.0.0/warmup_ramp/core.py +61 -0
- warmup_ramp_planner-1.0.0/warmup_ramp_planner.egg-info/PKG-INFO +42 -0
- warmup_ramp_planner-1.0.0/warmup_ramp_planner.egg-info/SOURCES.txt +13 -0
- warmup_ramp_planner-1.0.0/warmup_ramp_planner.egg-info/dependency_links.txt +1 -0
- warmup_ramp_planner-1.0.0/warmup_ramp_planner.egg-info/entry_points.txt +2 -0
- warmup_ramp_planner-1.0.0/warmup_ramp_planner.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OneGTMLab
|
|
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.
|
|
22
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: warmup-ramp-planner
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Plan a gradual email warmup ramp for a new mailbox and check each day's results before raising volume.
|
|
5
|
+
Author: Jainendra Ojha
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://www.onegtmlab.dev/glossary/email-warmup
|
|
8
|
+
Project-URL: Source, https://github.com/jaizendra-netizen/warmup-ramp-planner
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# warmup-ramp-planner
|
|
15
|
+
|
|
16
|
+
Email warmup means gradually increasing how much a new mailbox or domain sends, so mailbox providers can build a sending
|
|
17
|
+
reputation before larger campaigns begin. This tool does two small jobs for that: it prints a **ramp schedule** (start low,
|
|
18
|
+
raise step by step, skip weekends) and it **checks each day's log** (sends, bounces, complaints) against limits you set, so you
|
|
19
|
+
only raise volume when yesterday looked healthy. Python 3.8+, standard library only.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python -m warmup_ramp plan --start 5 --step 5 --target 30 --start-date 2026-01-05
|
|
23
|
+
python -m warmup_ramp check log.csv --max-bounce-rate 0.02 --max-complaint-rate 0.001
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`log.csv` needs the columns `date,sent,bounces,complaints` (a `replies` column is allowed). `check` exits with 1 when any day is
|
|
27
|
+
a `hold`. The numbers above are examples only: choose start, step, target and limits for your own provider and domain. The tool
|
|
28
|
+
does not ship a "safe" number.
|
|
29
|
+
|
|
30
|
+
Before day 1 the domain should already have SPF, DKIM and DMARC. Warmup prepares reputation; it cannot fix poor targeting, so a
|
|
31
|
+
warmed mailbox that sends to unverified lists still loses reputation.
|
|
32
|
+
|
|
33
|
+
## Test
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python -m unittest discover -s tests
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Source of the rules
|
|
40
|
+
|
|
41
|
+
Definition and guidance: [Email Warmup in the OneGTMLab GTM glossary](https://www.onegtmlab.dev/glossary/email-warmup).
|
|
42
|
+
MIT licensed.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# warmup-ramp-planner
|
|
2
|
+
|
|
3
|
+
Email warmup means gradually increasing how much a new mailbox or domain sends, so mailbox providers can build a sending
|
|
4
|
+
reputation before larger campaigns begin. This tool does two small jobs for that: it prints a **ramp schedule** (start low,
|
|
5
|
+
raise step by step, skip weekends) and it **checks each day's log** (sends, bounces, complaints) against limits you set, so you
|
|
6
|
+
only raise volume when yesterday looked healthy. Python 3.8+, standard library only.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
python -m warmup_ramp plan --start 5 --step 5 --target 30 --start-date 2026-01-05
|
|
10
|
+
python -m warmup_ramp check log.csv --max-bounce-rate 0.02 --max-complaint-rate 0.001
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`log.csv` needs the columns `date,sent,bounces,complaints` (a `replies` column is allowed). `check` exits with 1 when any day is
|
|
14
|
+
a `hold`. The numbers above are examples only: choose start, step, target and limits for your own provider and domain. The tool
|
|
15
|
+
does not ship a "safe" number.
|
|
16
|
+
|
|
17
|
+
Before day 1 the domain should already have SPF, DKIM and DMARC. Warmup prepares reputation; it cannot fix poor targeting, so a
|
|
18
|
+
warmed mailbox that sends to unverified lists still loses reputation.
|
|
19
|
+
|
|
20
|
+
## Test
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
python -m unittest discover -s tests
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Source of the rules
|
|
27
|
+
|
|
28
|
+
Definition and guidance: [Email Warmup in the OneGTMLab GTM glossary](https://www.onegtmlab.dev/glossary/email-warmup).
|
|
29
|
+
MIT licensed.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "warmup-ramp-planner"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "Plan a gradual email warmup ramp for a new mailbox and check each day's results before raising volume."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [{ name = "Jainendra Ojha" }]
|
|
7
|
+
requires-python = ">=3.8"
|
|
8
|
+
license = {text = "MIT"}
|
|
9
|
+
|
|
10
|
+
[project.scripts]
|
|
11
|
+
warmup-ramp = "warmup_ramp.cli:main"
|
|
12
|
+
|
|
13
|
+
[project.urls]
|
|
14
|
+
Homepage = "https://www.onegtmlab.dev/glossary/email-warmup"
|
|
15
|
+
Source = "https://github.com/jaizendra-netizen/warmup-ramp-planner"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import unittest, tempfile, os
|
|
2
|
+
from datetime import date
|
|
3
|
+
from warmup_ramp import core, cli
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class T(unittest.TestCase):
|
|
7
|
+
def test_plan_reaches_target(self):
|
|
8
|
+
rows = core.plan(2, 2, 6, start_date=date(2026, 1, 5))
|
|
9
|
+
self.assertEqual([r["send_limit"] for r in rows], [2, 4, 6])
|
|
10
|
+
|
|
11
|
+
def test_plan_days_per_step(self):
|
|
12
|
+
rows = core.plan(5, 5, 10, days_per_step=2, start_date=date(2026, 1, 5))
|
|
13
|
+
self.assertEqual([r["send_limit"] for r in rows], [5, 5, 10])
|
|
14
|
+
|
|
15
|
+
def test_weekends_skipped(self):
|
|
16
|
+
rows = core.plan(1, 1, 3, start_date=date(2026, 1, 9)) # Friday
|
|
17
|
+
self.assertEqual([r["date"] for r in rows], ["2026-01-09", "2026-01-12", "2026-01-13"])
|
|
18
|
+
|
|
19
|
+
def test_bad_input(self):
|
|
20
|
+
with self.assertRaises(ValueError):
|
|
21
|
+
core.plan(10, 1, 5)
|
|
22
|
+
|
|
23
|
+
def test_check_hold_and_raise(self):
|
|
24
|
+
log = [{"date": "d1", "sent": "100", "bounces": "1", "complaints": "0"},
|
|
25
|
+
{"date": "d2", "sent": "100", "bounces": "5", "complaints": "0"},
|
|
26
|
+
{"date": "d3", "sent": "1000", "bounces": "0", "complaints": "3"}]
|
|
27
|
+
v = core.check(log, 0.02, 0.001)
|
|
28
|
+
self.assertEqual([x["verdict"] for x in v], ["raise", "hold", "hold"])
|
|
29
|
+
|
|
30
|
+
def test_cli_check_exit_code(self):
|
|
31
|
+
with tempfile.TemporaryDirectory() as d:
|
|
32
|
+
p = os.path.join(d, "log.csv")
|
|
33
|
+
open(p, "w").write("date,sent,bounces,complaints\n2026-01-05,100,10,0\n")
|
|
34
|
+
self.assertEqual(cli.main(["check", p, "--max-bounce-rate", "0.02", "--max-complaint-rate", "0.001"]), 1)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if __name__ == "__main__":
|
|
38
|
+
unittest.main()
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import argparse, csv, json, sys
|
|
2
|
+
from datetime import date
|
|
3
|
+
from . import core
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main(argv=None):
|
|
7
|
+
p = argparse.ArgumentParser(prog="warmup-ramp", description="Plan an email warmup ramp and check daily results.")
|
|
8
|
+
sub = p.add_subparsers(dest="cmd", required=True)
|
|
9
|
+
a = sub.add_parser("plan", help="print a ramp schedule")
|
|
10
|
+
a.add_argument("--start", type=int, required=True, help="first-day sends per mailbox")
|
|
11
|
+
a.add_argument("--step", type=int, required=True, help="sends added at each step")
|
|
12
|
+
a.add_argument("--target", type=int, required=True, help="daily volume to reach")
|
|
13
|
+
a.add_argument("--days-per-step", type=int, default=1)
|
|
14
|
+
a.add_argument("--start-date", type=date.fromisoformat, default=None)
|
|
15
|
+
a.add_argument("--weekends", action="store_true", help="include weekends")
|
|
16
|
+
a.add_argument("--json", action="store_true")
|
|
17
|
+
c = sub.add_parser("check", help="check a daily log before raising volume")
|
|
18
|
+
c.add_argument("log", help="CSV with date,sent,bounces,complaints[,replies]")
|
|
19
|
+
c.add_argument("--max-bounce-rate", type=float, required=True, help="e.g. 0.02 for 2%%")
|
|
20
|
+
c.add_argument("--max-complaint-rate", type=float, required=True, help="e.g. 0.001 for 0.1%%")
|
|
21
|
+
c.add_argument("--json", action="store_true")
|
|
22
|
+
args = p.parse_args(argv)
|
|
23
|
+
try:
|
|
24
|
+
if args.cmd == "plan":
|
|
25
|
+
rows = core.plan(args.start, args.step, args.target, args.days_per_step, args.start_date, not args.weekends)
|
|
26
|
+
if args.json:
|
|
27
|
+
print(json.dumps(rows, indent=2))
|
|
28
|
+
else:
|
|
29
|
+
print("Before day 1, SPF, DKIM and DMARC must be set on the domain.")
|
|
30
|
+
for r in rows:
|
|
31
|
+
print("day %2d %s %d" % (r["day"], r["date"], r["send_limit"]))
|
|
32
|
+
else:
|
|
33
|
+
res = core.check(core.read_log(args.log), args.max_bounce_rate, args.max_complaint_rate)
|
|
34
|
+
if args.json:
|
|
35
|
+
print(json.dumps(res, indent=2))
|
|
36
|
+
else:
|
|
37
|
+
for r in res:
|
|
38
|
+
print("%s %-5s %s" % (r["date"], r["verdict"], r["reason"]))
|
|
39
|
+
return 1 if any(r["verdict"] == "hold" for r in res) else 0
|
|
40
|
+
except (ValueError, OSError) as e:
|
|
41
|
+
print("error: %s" % e, file=sys.stderr)
|
|
42
|
+
return 2
|
|
43
|
+
return 0
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if __name__ == "__main__":
|
|
47
|
+
sys.exit(main())
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Warmup ramp: start low, raise volume step by step, watch bounces, complaints and replies."""
|
|
2
|
+
import csv
|
|
3
|
+
from datetime import date, timedelta
|
|
4
|
+
|
|
5
|
+
PREREQUISITES = ["SPF", "DKIM", "DMARC"] # set up on the domain before warmup begins
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def plan(start, step, target, days_per_step=1, start_date=None, skip_weekends=True):
|
|
9
|
+
"""Daily send volume per sending day, rising by `step` every `days_per_step` sending days until `target`."""
|
|
10
|
+
for name, v in (("start", start), ("step", step), ("target", target), ("days_per_step", days_per_step)):
|
|
11
|
+
if not isinstance(v, int) or v < 1:
|
|
12
|
+
raise ValueError("%s must be a positive integer" % name)
|
|
13
|
+
if start > target:
|
|
14
|
+
raise ValueError("start cannot be above target")
|
|
15
|
+
d = start_date or date.today()
|
|
16
|
+
rows, vol, sent_days = [], start, 0
|
|
17
|
+
while True:
|
|
18
|
+
if skip_weekends and d.weekday() >= 5:
|
|
19
|
+
d += timedelta(days=1)
|
|
20
|
+
continue
|
|
21
|
+
rows.append({"day": len(rows) + 1, "date": d.isoformat(), "send_limit": vol})
|
|
22
|
+
if vol >= target:
|
|
23
|
+
break
|
|
24
|
+
sent_days += 1
|
|
25
|
+
if sent_days % days_per_step == 0:
|
|
26
|
+
vol = min(target, vol + step)
|
|
27
|
+
d += timedelta(days=1)
|
|
28
|
+
return rows
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def check(log_rows, max_bounce_rate, max_complaint_rate):
|
|
32
|
+
"""Read a daily log (sent, bounces, complaints, replies) and say whether it is safe to raise volume.
|
|
33
|
+
|
|
34
|
+
Returns one verdict per row: 'raise' when bounce and complaint rates are within the limits you set,
|
|
35
|
+
'hold' when either is above its limit. Limits are yours to set: this tool does not know your provider.
|
|
36
|
+
"""
|
|
37
|
+
out = []
|
|
38
|
+
for r in log_rows:
|
|
39
|
+
sent = int(r["sent"])
|
|
40
|
+
if sent < 1:
|
|
41
|
+
out.append({**r, "bounce_rate": 0.0, "complaint_rate": 0.0, "verdict": "hold", "reason": "nothing sent"})
|
|
42
|
+
continue
|
|
43
|
+
b = int(r["bounces"]) / sent
|
|
44
|
+
c = int(r["complaints"]) / sent
|
|
45
|
+
reasons = []
|
|
46
|
+
if b > max_bounce_rate:
|
|
47
|
+
reasons.append("bounce rate %.2f%% above %.2f%%" % (b * 100, max_bounce_rate * 100))
|
|
48
|
+
if c > max_complaint_rate:
|
|
49
|
+
reasons.append("complaint rate %.2f%% above %.2f%%" % (c * 100, max_complaint_rate * 100))
|
|
50
|
+
out.append({**r, "bounce_rate": round(b, 4), "complaint_rate": round(c, 4),
|
|
51
|
+
"verdict": "hold" if reasons else "raise", "reason": "; ".join(reasons)})
|
|
52
|
+
return out
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def read_log(path):
|
|
56
|
+
with open(path, newline="") as f:
|
|
57
|
+
rows = list(csv.DictReader(f))
|
|
58
|
+
need = {"date", "sent", "bounces", "complaints"}
|
|
59
|
+
if not rows or not need.issubset(rows[0].keys()):
|
|
60
|
+
raise ValueError("log needs columns: date, sent, bounces, complaints (replies optional)")
|
|
61
|
+
return rows
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: warmup-ramp-planner
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Plan a gradual email warmup ramp for a new mailbox and check each day's results before raising volume.
|
|
5
|
+
Author: Jainendra Ojha
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://www.onegtmlab.dev/glossary/email-warmup
|
|
8
|
+
Project-URL: Source, https://github.com/jaizendra-netizen/warmup-ramp-planner
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# warmup-ramp-planner
|
|
15
|
+
|
|
16
|
+
Email warmup means gradually increasing how much a new mailbox or domain sends, so mailbox providers can build a sending
|
|
17
|
+
reputation before larger campaigns begin. This tool does two small jobs for that: it prints a **ramp schedule** (start low,
|
|
18
|
+
raise step by step, skip weekends) and it **checks each day's log** (sends, bounces, complaints) against limits you set, so you
|
|
19
|
+
only raise volume when yesterday looked healthy. Python 3.8+, standard library only.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python -m warmup_ramp plan --start 5 --step 5 --target 30 --start-date 2026-01-05
|
|
23
|
+
python -m warmup_ramp check log.csv --max-bounce-rate 0.02 --max-complaint-rate 0.001
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`log.csv` needs the columns `date,sent,bounces,complaints` (a `replies` column is allowed). `check` exits with 1 when any day is
|
|
27
|
+
a `hold`. The numbers above are examples only: choose start, step, target and limits for your own provider and domain. The tool
|
|
28
|
+
does not ship a "safe" number.
|
|
29
|
+
|
|
30
|
+
Before day 1 the domain should already have SPF, DKIM and DMARC. Warmup prepares reputation; it cannot fix poor targeting, so a
|
|
31
|
+
warmed mailbox that sends to unverified lists still loses reputation.
|
|
32
|
+
|
|
33
|
+
## Test
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python -m unittest discover -s tests
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Source of the rules
|
|
40
|
+
|
|
41
|
+
Definition and guidance: [Email Warmup in the OneGTMLab GTM glossary](https://www.onegtmlab.dev/glossary/email-warmup).
|
|
42
|
+
MIT licensed.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
tests/test_warmup.py
|
|
5
|
+
warmup_ramp/__init__.py
|
|
6
|
+
warmup_ramp/__main__.py
|
|
7
|
+
warmup_ramp/cli.py
|
|
8
|
+
warmup_ramp/core.py
|
|
9
|
+
warmup_ramp_planner.egg-info/PKG-INFO
|
|
10
|
+
warmup_ramp_planner.egg-info/SOURCES.txt
|
|
11
|
+
warmup_ramp_planner.egg-info/dependency_links.txt
|
|
12
|
+
warmup_ramp_planner.egg-info/entry_points.txt
|
|
13
|
+
warmup_ramp_planner.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
warmup_ramp
|