imap-cleanup-tool 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.
Files changed (28) hide show
  1. imap_cleanup_tool-0.1.0/.gitattributes +4 -0
  2. imap_cleanup_tool-0.1.0/.github/workflows/build-and-release.yml +67 -0
  3. imap_cleanup_tool-0.1.0/.gitignore +37 -0
  4. imap_cleanup_tool-0.1.0/CLA.md +91 -0
  5. imap_cleanup_tool-0.1.0/CONTRIBUTING.md +66 -0
  6. imap_cleanup_tool-0.1.0/LICENSE +661 -0
  7. imap_cleanup_tool-0.1.0/PKG-INFO +485 -0
  8. imap_cleanup_tool-0.1.0/README.md +457 -0
  9. imap_cleanup_tool-0.1.0/pyproject.toml +45 -0
  10. imap_cleanup_tool-0.1.0/requirements.txt +11 -0
  11. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/__init__.py +53 -0
  12. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/assets/logo.png +0 -0
  13. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/cli.py +235 -0
  14. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/core.py +387 -0
  15. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/profiles.py +155 -0
  16. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/rule_parser.py +117 -0
  17. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/rules.py +170 -0
  18. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/scheduler.py +489 -0
  19. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/targets.py +91 -0
  20. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/web/providers.json +54 -0
  21. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/web/static/index.html +1025 -0
  22. imap_cleanup_tool-0.1.0/src/imap_cleanup_tool/webapp.py +703 -0
  23. imap_cleanup_tool-0.1.0/tests/test_profiles.py +88 -0
  24. imap_cleanup_tool-0.1.0/tests/test_rule_parser.py +71 -0
  25. imap_cleanup_tool-0.1.0/tests/test_rules.py +132 -0
  26. imap_cleanup_tool-0.1.0/tests/test_scheduler.py +234 -0
  27. imap_cleanup_tool-0.1.0/tests/test_targets.py +92 -0
  28. imap_cleanup_tool-0.1.0/tests/test_webapp.py +132 -0
@@ -0,0 +1,4 @@
1
+ # Normalize line endings: store text as LF in the repo, check out native.
2
+ * text=auto eol=lf
3
+ *.bat text eol=crlf
4
+ *.ps1 text eol=crlf
@@ -0,0 +1,67 @@
1
+ name: publish
2
+
3
+ # Build the package once, then publish it via PyPI Trusted Publishing (OIDC):
4
+ # * Manual run ("Run workflow" button) -> publishes to TestPyPI.
5
+ # * Pushing a v* tag -> publishes to the real PyPI.
6
+ # No API tokens/secrets are used: the workflow's OIDC identity is the credential,
7
+ # matched against the trusted publisher configured on (Test)PyPI.
8
+
9
+ on:
10
+ workflow_dispatch: # manual button in the Actions tab -> TestPyPI
11
+ push:
12
+ tags:
13
+ - "v*" # pushing a v* tag -> real PyPI
14
+
15
+ jobs:
16
+ build:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v5
20
+ - uses: actions/setup-python@v6
21
+ with:
22
+ python-version: "3.12"
23
+ - name: Build sdist and wheel
24
+ run: |
25
+ python -m pip install --upgrade pip build
26
+ python -m build
27
+ - name: Upload the built distributions
28
+ uses: actions/upload-artifact@v5
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ publish-testpypi:
34
+ # Only manual runs publish to TestPyPI (for testing a release).
35
+ if: github.event_name == 'workflow_dispatch'
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ environment: testpypi # must match the TestPyPI trusted-publisher env
39
+ permissions:
40
+ id-token: write # required to mint the OIDC token
41
+ steps:
42
+ - name: Download the built distributions
43
+ uses: actions/download-artifact@v5
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+ - name: Publish to TestPyPI
48
+ uses: pypa/gh-action-pypi-publish@release/v1
49
+ with:
50
+ repository-url: https://test.pypi.org/legacy/
51
+
52
+ publish-pypi:
53
+ # Only v* tags publish to the real PyPI (the actual release).
54
+ if: startsWith(github.ref, 'refs/tags/v')
55
+ needs: build
56
+ runs-on: ubuntu-latest
57
+ environment: pypi # must match the PyPI trusted-publisher env
58
+ permissions:
59
+ id-token: write
60
+ steps:
61
+ - name: Download the built distributions
62
+ uses: actions/download-artifact@v5
63
+ with:
64
+ name: dist
65
+ path: dist/
66
+ - name: Publish to PyPI
67
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,37 @@
1
+ # Byte-compiled / build artifacts
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .eggs/
8
+
9
+ # Virtual environments
10
+ .venv/
11
+ venv/
12
+ env/
13
+
14
+ # PyInstaller
15
+ *.spec
16
+ *.manifest
17
+
18
+ # Tooling
19
+ .pylint.d/
20
+ .pytest_cache/
21
+ .mypy_cache/
22
+
23
+ # OS / editor
24
+ .DS_Store
25
+ Thumbs.db
26
+ .idea/
27
+ .vscode/
28
+
29
+ # App data that may be created locally
30
+ *.csv
31
+ targets.txt
32
+ jobs.json
33
+
34
+ # AI assistant working files (kept local, not published)
35
+ CLAUDE.md
36
+ memory-bank/
37
+ .claude/
@@ -0,0 +1,91 @@
1
+ # Contributor License Agreement (CLA)
2
+
3
+ **Project:** imap-cleanup-tool
4
+ **Project Owner / Licensor:** Giulio Alberello ("the Owner")
5
+ **Contact:** info@giulioalberello.it
6
+
7
+ Thank you for contributing to imap-cleanup-tool. To keep the project legally
8
+ clean and to let its licensing be managed consistently over time, every
9
+ contributor agrees to this Contributor License Agreement before their
10
+ contribution can be merged. This is a standard mechanism used by many
11
+ open-source projects (for example those maintained under the Apache or Google
12
+ CLA models).
13
+
14
+ It does **not** take your copyright away: you keep full ownership of your
15
+ contributions and remain free to use them however you like. You simply grant the
16
+ Owner a broad license so the Owner can manage the licensing of the project as a
17
+ whole.
18
+
19
+ By submitting a contribution (a pull request, patch, or any other work) to this
20
+ project, **you agree to the terms below for that and all your future
21
+ contributions** to the project.
22
+
23
+ ---
24
+
25
+ ## 1. Definitions
26
+
27
+ - **"You"** means the individual or legal entity making a Contribution.
28
+ - **"Contribution"** means any original work of authorship - including code,
29
+ documentation, configuration, or assets - that You intentionally submit to the
30
+ project for inclusion in, or documentation of, the project.
31
+ - **"Submit"** means any form of communication sent to the project (e.g. a pull
32
+ request, commit, issue attachment, or message), excluding communication
33
+ conspicuously marked "Not a Contribution".
34
+
35
+ ## 2. Copyright License
36
+
37
+ You hereby grant **to the Owner** (and to no one else) a **perpetual, worldwide,
38
+ non-exclusive, royalty-free, irrevocable copyright license** to reproduce,
39
+ prepare derivative works of, publicly display, publicly perform, sublicense, and
40
+ distribute Your Contributions and such derivative works, **under any license
41
+ terms the Owner chooses**, including the project's current license, the
42
+ **AGPL-3.0-or-later**.
43
+
44
+ This means the Owner - and only the Owner - may set and change the terms under
45
+ which the project as a whole is licensed. You retain all right, title, and
46
+ interest in Your Contributions; this is a license grant, **not an assignment** of
47
+ copyright.
48
+
49
+ ## 3. Patent License
50
+
51
+ You grant the Owner and recipients of the software a **perpetual, worldwide,
52
+ non-exclusive, royalty-free, irrevocable patent license** to make, use, sell,
53
+ offer to sell, import, and otherwise transfer Your Contributions, where such
54
+ license applies only to patent claims licensable by You that are necessarily
55
+ infringed by Your Contribution alone or by combination of Your Contribution with
56
+ the project.
57
+
58
+ ## 4. Your Representations
59
+
60
+ You represent that:
61
+
62
+ 1. Each Contribution is **Your original creation**, or You have the right to
63
+ submit it under the terms of this CLA.
64
+ 2. If Your employer has rights to intellectual property You create, You have
65
+ either received permission to make the Contribution on behalf of that
66
+ employer, or the employer has waived such rights.
67
+ 3. Your Contribution does not, to Your knowledge, violate any third party's
68
+ copyright, patent, trademark, trade secret, or other rights.
69
+ 4. You are **legally entitled to grant** the licenses above.
70
+
71
+ ## 5. Developer Certificate of Origin (DCO)
72
+
73
+ In addition, each commit you submit must certify the
74
+ [Developer Certificate of Origin 1.1](https://developercertificate.org/) by
75
+ adding a `Signed-off-by` line (`git commit -s`). This is a lightweight,
76
+ machine-checkable confirmation of Section 4.
77
+
78
+ ## 6. No Obligation
79
+
80
+ The Owner is under no obligation to accept or use any Contribution. Contributions
81
+ are provided **"as is"**, without warranty of any kind.
82
+
83
+ ---
84
+
85
+ > **Not legal advice.** This CLA is a good-faith template for a solo-maintained
86
+ > open-source project. The Owner should have it reviewed by a qualified lawyer in
87
+ > the relevant jurisdiction before relying on it.
88
+
89
+ **How to agree:** open a pull request; the first time you do, state in a comment
90
+ "I have read the CLA and I agree to it", and sign your commits with `git commit
91
+ -s`. (A bot-enforced CLA check may be added later.)
@@ -0,0 +1,66 @@
1
+ # Contributing to imap-cleanup-tool
2
+
3
+ Thanks for your interest in improving imap-cleanup-tool! Bug reports, fixes, and
4
+ features are welcome.
5
+
6
+ ## Licensing of contributions (important)
7
+
8
+ This project is published under the **AGPL-3.0**. So that its licensing can be
9
+ managed consistently, **all contributions are accepted under the
10
+ [Contributor License Agreement (CLA)](CLA.md)** - the same approach used by many
11
+ open-source projects.
12
+
13
+ In short, by submitting a pull request you:
14
+
15
+ 1. **Agree to the [CLA](CLA.md)** - you keep ownership of your work and grant the
16
+ project owner a broad license to manage the project's licensing.
17
+ 2. **Sign off your commits** with the Developer Certificate of Origin:
18
+
19
+ ```bash
20
+ git commit -s -m "your message" # adds a Signed-off-by line
21
+ ```
22
+
23
+ The first time you open a PR, please add a comment: *"I have read the CLA and I
24
+ agree to it."*
25
+
26
+ ## Development setup
27
+
28
+ ```bash
29
+ git clone https://github.com/mrpickles007/imap-cleanup-tool.git
30
+ cd imap-cleanup-tool
31
+
32
+ python -m venv .venv
33
+ source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
34
+
35
+ pip install -e ".[dev,web]" # editable install + dev tools + web UI
36
+ ```
37
+
38
+ ## Before you open a PR
39
+
40
+ - **Run the tests** (standard library only, nothing extra to install):
41
+
42
+ ```bash
43
+ python -m unittest discover -s tests -v
44
+ ```
45
+
46
+ - **Add or update tests** for any behavior you change.
47
+ - **Match the codebase conventions** (see [CLAUDE.md](CLAUDE.md) for the golden
48
+ rules). The most important ones:
49
+ - **English only** in code, comments, UI strings, and docs.
50
+ - **CLI and `core.py` stay standard-library only.** Third-party dependencies
51
+ belong exclusively in the optional `[web]` extra.
52
+ - **`core.py` is UI-agnostic** - no argument parsing, no presentation.
53
+ - Preserve the **safety model**: dry-run by default in the web UI,
54
+ confirmation in the CLI, flag-then-`--expunge`.
55
+ - Honor **cooperative cancellation** (`should_stop` / `StopRequested`) in
56
+ long-running code.
57
+ - Keep PRs focused; describe the change and how you tested it.
58
+
59
+ ## Reporting bugs / requesting features
60
+
61
+ Open a GitHub issue with steps to reproduce (for bugs) or a clear use case (for
62
+ features). Never include real passwords or app passwords in issues or logs.
63
+
64
+ ## Code of conduct
65
+
66
+ Be respectful and constructive. Harassment or abuse will not be tolerated.