reels-wiki 0.1.2__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 (59) hide show
  1. reels_wiki-0.1.2/.editorconfig +15 -0
  2. reels_wiki-0.1.2/.env.example +15 -0
  3. reels_wiki-0.1.2/.gitattributes +17 -0
  4. reels_wiki-0.1.2/.github/CODEOWNERS +1 -0
  5. reels_wiki-0.1.2/.github/ISSUE_TEMPLATE/bug_report.yml +26 -0
  6. reels_wiki-0.1.2/.github/ISSUE_TEMPLATE/feature_request.yml +19 -0
  7. reels_wiki-0.1.2/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +9 -0
  8. reels_wiki-0.1.2/.github/dependabot.yml +10 -0
  9. reels_wiki-0.1.2/.github/workflows/ci.yml +41 -0
  10. reels_wiki-0.1.2/.github/workflows/pages.yml +53 -0
  11. reels_wiki-0.1.2/.github/workflows/release-please.yml +88 -0
  12. reels_wiki-0.1.2/.gitignore +48 -0
  13. reels_wiki-0.1.2/.markdownlint.json +6 -0
  14. reels_wiki-0.1.2/.release-please-manifest.json +3 -0
  15. reels_wiki-0.1.2/CHANGELOG.md +33 -0
  16. reels_wiki-0.1.2/CONTRIBUTING.md +38 -0
  17. reels_wiki-0.1.2/LICENSE +21 -0
  18. reels_wiki-0.1.2/Makefile +164 -0
  19. reels_wiki-0.1.2/PKG-INFO +348 -0
  20. reels_wiki-0.1.2/README.md +304 -0
  21. reels_wiki-0.1.2/ROADMAP.md +88 -0
  22. reels_wiki-0.1.2/SECURITY.md +19 -0
  23. reels_wiki-0.1.2/SKILL.md +51 -0
  24. reels_wiki-0.1.2/assets/logo.png +0 -0
  25. reels_wiki-0.1.2/config.example.yaml +34 -0
  26. reels_wiki-0.1.2/docs/README.md +14 -0
  27. reels_wiki-0.1.2/docs/architecture.md +68 -0
  28. reels_wiki-0.1.2/docs/cli-and-mcp.md +71 -0
  29. reels_wiki-0.1.2/docs/configuration.md +57 -0
  30. reels_wiki-0.1.2/docs/example-walkthrough.md +203 -0
  31. reels_wiki-0.1.2/docs/step-by-step.md +177 -0
  32. reels_wiki-0.1.2/docs/troubleshooting.md +57 -0
  33. reels_wiki-0.1.2/pyproject.toml +80 -0
  34. reels_wiki-0.1.2/release-please-config.json +31 -0
  35. reels_wiki-0.1.2/site/index.html +1629 -0
  36. reels_wiki-0.1.2/src/reels_wiki/__init__.py +35 -0
  37. reels_wiki-0.1.2/src/reels_wiki/cli.py +337 -0
  38. reels_wiki-0.1.2/src/reels_wiki/cli_ui.py +215 -0
  39. reels_wiki-0.1.2/src/reels_wiki/config.py +142 -0
  40. reels_wiki-0.1.2/src/reels_wiki/extractor.py +309 -0
  41. reels_wiki-0.1.2/src/reels_wiki/ig_export.py +85 -0
  42. reels_wiki-0.1.2/src/reels_wiki/mcp_server.py +83 -0
  43. reels_wiki-0.1.2/src/reels_wiki/models.py +80 -0
  44. reels_wiki-0.1.2/src/reels_wiki/pipeline.py +116 -0
  45. reels_wiki-0.1.2/src/reels_wiki/queue_manager.py +271 -0
  46. reels_wiki-0.1.2/src/reels_wiki/synthesizer.py +173 -0
  47. reels_wiki-0.1.2/src/reels_wiki/telegram_bot.py +164 -0
  48. reels_wiki-0.1.2/src/reels_wiki/utils.py +55 -0
  49. reels_wiki-0.1.2/src/reels_wiki/vault_context.py +200 -0
  50. reels_wiki-0.1.2/src/reels_wiki/writer.py +207 -0
  51. reels_wiki-0.1.2/tests/test_cli.py +203 -0
  52. reels_wiki-0.1.2/tests/test_extractor.py +90 -0
  53. reels_wiki-0.1.2/tests/test_ig_export.py +87 -0
  54. reels_wiki-0.1.2/tests/test_mcp_server.py +55 -0
  55. reels_wiki-0.1.2/tests/test_pipeline.py +83 -0
  56. reels_wiki-0.1.2/tests/test_queue_manager.py +161 -0
  57. reels_wiki-0.1.2/tests/test_synthesizer.py +96 -0
  58. reels_wiki-0.1.2/tests/test_telegram_bot.py +93 -0
  59. reels_wiki-0.1.2/tests/test_writer.py +212 -0
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ [*.py]
12
+ indent_size = 4
13
+
14
+ [Makefile]
15
+ indent_style = tab
@@ -0,0 +1,15 @@
1
+ # Copy to .env and fill in real credentials. Never commit .env.
2
+
3
+ # Required for Groq Whisper transcription and/or Groq LLM synthesis
4
+ GROQ_API_KEY=your_groq_api_key
5
+
6
+ # Required for Gemini Vision OCR fallback and/or Gemini LLM synthesis
7
+ GEMINI_API_KEY=your_gemini_api_key
8
+
9
+ # Optional: Telegram share capture bot (reels-sync telegram)
10
+ TELEGRAM_BOT_TOKEN=your_telegram_bot_token
11
+ TELEGRAM_ALLOWED_CHAT_ID=123456789
12
+
13
+ # Optional: runtime path overrides
14
+ # REELS_WIKI_CONFIG=./config.yaml
15
+ # REELS_WIKI_VAULT=~/Documents/ObsidianVault
@@ -0,0 +1,17 @@
1
+ * text=auto eol=lf
2
+
3
+ *.py text eol=lf
4
+ *.md text eol=lf
5
+ *.yml text eol=lf
6
+ *.yaml text eol=lf
7
+ *.toml text eol=lf
8
+ *.json text eol=lf
9
+ Makefile text eol=lf
10
+
11
+ *.png binary
12
+ *.jpg binary
13
+ *.jpeg binary
14
+ *.gif binary
15
+ *.ico binary
16
+ *.woff binary
17
+ *.woff2 binary
@@ -0,0 +1 @@
1
+ * @AtaCanYmc
@@ -0,0 +1,26 @@
1
+ name: Bug Report
2
+ description: Report a reproducible bug in reels-wiki
3
+ title: "fix: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: textarea
7
+ id: description
8
+ attributes:
9
+ label: Description
10
+ description: What happened vs. what you expected.
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: steps
15
+ attributes:
16
+ label: Reproduction Steps
17
+ description: Exact CLI command or Python call that triggers the issue.
18
+ validations:
19
+ required: true
20
+ - type: input
21
+ id: python
22
+ attributes:
23
+ label: Python Version
24
+ placeholder: "3.11"
25
+ validations:
26
+ required: true
@@ -0,0 +1,19 @@
1
+ name: Feature Request
2
+ description: Propose a new capability or improvement
3
+ title: "feat: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: textarea
7
+ id: problem
8
+ attributes:
9
+ label: Problem
10
+ description: What workflow or limitation does this address?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: proposal
15
+ attributes:
16
+ label: Proposed Solution
17
+ description: Describe the expected CLI, config, or module behavior.
18
+ validations:
19
+ required: true
@@ -0,0 +1,9 @@
1
+ ## Summary
2
+
3
+ Describe what changed and why.
4
+
5
+ ## Verification
6
+
7
+ - [ ] `make test` passes locally.
8
+ - [ ] Commit messages follow Conventional Commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`, `ci:`).
9
+ - [ ] No secrets, tokens, or personal vault paths included.
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,41 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Entrypoint smoke checks
30
+ run: |
31
+ reels-sync --help
32
+ python -c "from reels_wiki.cli import main, mcp_main, telegram_main"
33
+
34
+ - name: Lint with ruff
35
+ run: ruff check src tests
36
+
37
+ - name: Typecheck with mypy
38
+ run: mypy src/reels_wiki
39
+
40
+ - name: Run tests with coverage
41
+ run: pytest -v --cov=reels_wiki --cov-report=term-missing --cov-fail-under=70
@@ -0,0 +1,53 @@
1
+ name: Deploy GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ paths:
7
+ - "site/**"
8
+ - "assets/logo.png"
9
+ - ".github/workflows/pages.yml"
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ concurrency:
18
+ group: "pages"
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Setup Pages
29
+ uses: actions/configure-pages@v5
30
+
31
+ - name: Stage static site artifact
32
+ run: |
33
+ mkdir -p _site/assets
34
+ cp -r site/. _site/
35
+ cp assets/logo.png _site/assets/logo.png
36
+ python3 -c 'import pathlib; p = pathlib.Path("_site/index.html"); p.write_text(p.read_text().replace("../assets/logo.png", "assets/logo.png"))'
37
+ touch _site/.nojekyll
38
+
39
+ - name: Upload Pages artifact
40
+ uses: actions/upload-pages-artifact@v3
41
+ with:
42
+ path: _site
43
+
44
+ deploy:
45
+ environment:
46
+ name: github-pages
47
+ url: ${{ steps.deployment.outputs.page_url }}
48
+ runs-on: ubuntu-latest
49
+ needs: build
50
+ steps:
51
+ - name: Deploy to GitHub Pages
52
+ id: deployment
53
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,88 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ workflow_dispatch:
7
+
8
+ concurrency:
9
+ group: release-please-${{ github.ref }}
10
+ cancel-in-progress: false
11
+
12
+ permissions:
13
+ contents: write
14
+ pull-requests: write
15
+
16
+ jobs:
17
+ release-please:
18
+ runs-on: ubuntu-latest
19
+ outputs:
20
+ release_created: ${{ steps.release.outputs.release_created }}
21
+ tag_name: ${{ steps.release.outputs.tag_name }}
22
+ steps:
23
+ - name: Run release-please
24
+ id: release
25
+ uses: googleapis/release-please-action@v4
26
+ with:
27
+ config-file: release-please-config.json
28
+ manifest-file: .release-please-manifest.json
29
+
30
+ build-release-assets:
31
+ needs: release-please
32
+ if: ${{ needs.release-please.outputs.release_created == 'true' }}
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - name: Checkout release tag
36
+ uses: actions/checkout@v4
37
+ with:
38
+ ref: ${{ needs.release-please.outputs.tag_name }}
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: "3.12"
44
+
45
+ - name: Build wheel and source distribution
46
+ run: |
47
+ python -m pip install --upgrade pip build
48
+ python -m build
49
+
50
+ - name: Generate SHA256 checksums
51
+ run: sha256sum dist/*.whl dist/*.tar.gz > dist/SHA256SUMS.txt
52
+
53
+ - name: Upload release assets
54
+ env:
55
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56
+ run: |
57
+ gh release upload "${{ needs.release-please.outputs.tag_name }}" \
58
+ dist/*.whl \
59
+ dist/*.tar.gz \
60
+ dist/SHA256SUMS.txt \
61
+ --clobber
62
+
63
+ - name: Upload package distributions for PyPI
64
+ uses: actions/upload-artifact@v4
65
+ with:
66
+ name: python-package-distributions
67
+ path: |
68
+ dist/*.whl
69
+ dist/*.tar.gz
70
+
71
+ publish-pypi:
72
+ needs: [release-please, build-release-assets]
73
+ if: ${{ needs.release-please.outputs.release_created == 'true' }}
74
+ runs-on: ubuntu-latest
75
+ environment:
76
+ name: pypi
77
+ url: https://pypi.org/p/reels-wiki
78
+ permissions:
79
+ id-token: write
80
+ steps:
81
+ - name: Download package distributions
82
+ uses: actions/download-artifact@v4
83
+ with:
84
+ name: python-package-distributions
85
+ path: dist/
86
+
87
+ - name: Publish package distributions to PyPI
88
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,48 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+ env/
28
+
29
+ # Testing
30
+ .pytest_cache/
31
+ .coverage
32
+ htmlcov/
33
+ .tox/
34
+ .nox/
35
+
36
+ # IDEs & OS
37
+ .idea/
38
+ .vscode/
39
+ *.swp
40
+ *.swo
41
+ .DS_Store
42
+ Thumbs.db
43
+
44
+ # Secrets & local config
45
+ .env
46
+ .env.*
47
+ !.env.example
48
+ config.yaml
@@ -0,0 +1,6 @@
1
+ {
2
+ "default": true,
3
+ "MD013": false,
4
+ "MD033": false,
5
+ "MD041": false
6
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.2"
3
+ }
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ ## [0.1.2](https://github.com/AtaCanYmc/reels-wiki/compare/v0.1.1...v0.1.2) (2026-11-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * enhance CLI output with Rich UI for various commands and add JSON mode support ([8ed0f13](https://github.com/AtaCanYmc/reels-wiki/commit/8ed0f133d186a0b3a6ff0f17a54678d44a88a3d3))
9
+ * implement v0.2.0 quality gates, doctor CLI, tests, and troubleshooting docs ([0d1f3b6](https://github.com/AtaCanYmc/reels-wiki/commit/0d1f3b65300b8f7b80b2d33c9481fc2755464a02))
10
+
11
+ ## [0.1.1](https://github.com/AtaCanYmc/reels-wiki/compare/v0.1.0...v0.1.1) (2026-11-23)
12
+
13
+
14
+ ### Features
15
+
16
+ * add initial HTML structure and GitHub Pages deployment workflow ([886868c](https://github.com/AtaCanYmc/reels-wiki/commit/886868cc356aacf5dbacb7839e5b15e722fb51b8))
17
+ * enhance error handling and redact sensitive information in Telegram bot ([55e4af8](https://github.com/AtaCanYmc/reels-wiki/commit/55e4af86fdf9d69311478ed3608503422188fb50))
18
+ * update project metadata and add PyPI publishing workflow ([23887b9](https://github.com/AtaCanYmc/reels-wiki/commit/23887b919460608ca88bb4923539fd938804e221))
19
+
20
+
21
+ ### Code Refactoring
22
+
23
+ * rename enqueue_url to enqueue and get_stats to queue_stats in CLI and Telegram bot tests ([736a64c](https://github.com/AtaCanYmc/reels-wiki/commit/736a64cf17e10efbb7b3f17162c8c1e74be926ba))
24
+ * update function names and improve config handling in CLI and server modules ([6616b6d](https://github.com/AtaCanYmc/reels-wiki/commit/6616b6d003fe2696a880a8da671f5b6b139779f0))
25
+
26
+
27
+ ### Documentation
28
+
29
+ * add architecture and configuration documentation for reels-wiki ([ec038e4](https://github.com/AtaCanYmc/reels-wiki/commit/ec038e47813c3e1ce7c031ac7bfa8cf4d73710de))
30
+ * add example walkthrough and step-by-step guide to documentation ([f7fd7ca](https://github.com/AtaCanYmc/reels-wiki/commit/f7fd7cac6b3f81702a700d2af19f8d2bcab5d7ab))
31
+ * add examples for CLI commands and configuration in documentation ([1e2f44a](https://github.com/AtaCanYmc/reels-wiki/commit/1e2f44af34ec89d7e6e3d1e0abf05312c62db211))
32
+ * add logo to README for branding ([85f3081](https://github.com/AtaCanYmc/reels-wiki/commit/85f3081dbb9425f15109c4fd2e3a071155f86431))
33
+ * enhance README with detailed setup instructions and usage examples ([62cf4eb](https://github.com/AtaCanYmc/reels-wiki/commit/62cf4ebc05f254636aabf9202f17e7aa0e38d5f0))
@@ -0,0 +1,38 @@
1
+ # Contributing
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ make install-dev
7
+ ```
8
+
9
+ ## Running Tests
10
+
11
+ ```bash
12
+ make test
13
+ ```
14
+
15
+ ## Branch Naming
16
+
17
+ Use short, descriptive branch names prefixed by type:
18
+
19
+ - `feat/<short-name>`
20
+ - `fix/<short-name>`
21
+ - `docs/<short-name>`
22
+ - `refactor/<short-name>`
23
+
24
+ ## Commit Format
25
+
26
+ Follow Conventional Commits:
27
+
28
+ ```text
29
+ <type>(<scope>): <subject>
30
+ ```
31
+
32
+ Allowed types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `ci`.
33
+
34
+ ## Pull Request Checklist
35
+
36
+ - [ ] Tests pass locally via `make test`.
37
+ - [ ] No real API keys, tokens, or personal vault paths are committed.
38
+ - [ ] Documentation is updated if CLI flags, config keys, or entry points changed.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AtaCanYmc
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,164 @@
1
+ .DEFAULT_GOAL := help
2
+
3
+ PYTHON ?= python3
4
+ VENV ?= .venv
5
+ VENV_PYTHON := $(VENV)/bin/python
6
+ PIP := $(VENV)/bin/pip
7
+ PYTEST := $(VENV)/bin/pytest
8
+ RUFF := $(VENV)/bin/ruff
9
+ MYPY := $(VENV)/bin/mypy
10
+ REELS_SYNC := $(VENV)/bin/reels-sync
11
+
12
+ CONFIG ?=
13
+ VAULT ?=
14
+ LIMIT ?= 10
15
+ URL ?=
16
+ SHORTCODE ?=
17
+ EXPORT_DIR ?=
18
+ K ?=
19
+
20
+ GLOBAL_FLAGS := $(if $(CONFIG),--config "$(CONFIG)",) $(if $(VAULT),--vault "$(VAULT)",)
21
+
22
+ .PHONY: help venv install install-dev install-local install-all update-yt-dlp init-config doctor \
23
+ test test-fast test-match test-cov lint typecheck check-docs check-release verify \
24
+ stats stats-json ingest import-ig process-dry process retry-failed reprocess reprocess-all telegram mcp \
25
+ build clean clean-all
26
+
27
+ help: ## Show available targets grouped by category
28
+ @echo "reels-wiki Makefile targets"
29
+ @echo ""
30
+ @echo "Variables: CONFIG= VAULT= LIMIT=$(LIMIT) URL= SHORTCODE= EXPORT_DIR= K="
31
+ @echo ""
32
+ @awk 'BEGIN {FS = ":.*## "} \
33
+ /^# --- / { printf "\n\033[1m%s\033[0m\n", substr($$0, 7); next } \
34
+ /^[a-zA-Z0-9_.-]+:.*## / { printf " \033[36m%-18s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
35
+
36
+ # --- Setup & Environment
37
+ $(VENV_PYTHON):
38
+ $(PYTHON) -m venv $(VENV)
39
+
40
+ venv: $(VENV_PYTHON) ## Create Python virtual environment in $(VENV)
41
+
42
+ install: $(VENV_PYTHON) ## Install package in editable mode
43
+ $(PIP) install -e .
44
+
45
+ install-dev: $(VENV_PYTHON) ## Install package with dev dependencies
46
+ $(PIP) install -e ".[dev]"
47
+
48
+ install-local: $(VENV_PYTHON) ## Install package with local faster-whisper dependencies
49
+ $(PIP) install -e ".[local]"
50
+
51
+ install-all: $(VENV_PYTHON) ## Install package with dev and local dependencies
52
+ $(PIP) install -e ".[dev,local]"
53
+
54
+ update-yt-dlp: $(VENV_PYTHON) ## Upgrade yt-dlp to latest release
55
+ $(PIP) install -U yt-dlp
56
+
57
+ init-config: ## Copy config.example.yaml to config.yaml if missing
58
+ @if [ -f config.yaml ]; then \
59
+ echo "config.yaml already exists, skipping."; \
60
+ else \
61
+ cp config.example.yaml config.yaml && echo "Created config.yaml from config.example.yaml."; \
62
+ fi
63
+
64
+ doctor: ## Check Python, ffmpeg, virtual environment, and config files
65
+ @echo "Python: $$($(PYTHON) --version 2>&1)"
66
+ @echo "Venv: $$([ -x $(VENV_PYTHON) ] && $(VENV_PYTHON) --version || echo 'not created')"
67
+ @echo "ffmpeg: $$(command -v ffmpeg >/dev/null 2>&1 && ffmpeg -version | head -n 1 || echo 'missing (required only for audio/vision fallbacks)')"
68
+ @echo "config: $$([ -f config.yaml ] && echo 'config.yaml present' || echo 'config.yaml missing')"
69
+ @echo ".env: $$([ -f .env ] && echo '.env present' || echo '.env missing')"
70
+
71
+ # --- Testing & Quality
72
+ test: ## Run full pytest suite with verbose output
73
+ $(PYTEST) -v
74
+
75
+ test-fast: ## Run pytest stopping on first failure without verbose tracebacks
76
+ $(PYTEST) -x -q --tb=short
77
+
78
+ test-match: ## Run pytest matching K=<pattern>
79
+ @test -n "$(K)" || (echo "Usage: make test-match K=<pattern>" && exit 1)
80
+ $(PYTEST) -v -k "$(K)"
81
+
82
+ test-cov: ## Run pytest with coverage report and 70% minimum threshold
83
+ $(PYTEST) -v --cov=reels_wiki --cov-report=term-missing --cov-fail-under=70
84
+
85
+ lint: ## Run ruff linter on src and tests
86
+ $(RUFF) check src tests
87
+
88
+ typecheck: ## Run mypy type checker on src/reels_wiki
89
+ $(MYPY) src/reels_wiki
90
+
91
+ check-docs: ## Verify README links exist and polished docs have no em-dashes
92
+ @$(PYTHON) -c 'import pathlib, re; \
93
+ docs = [pathlib.Path("README.md")] + sorted(pathlib.Path("docs").glob("*.md")); \
94
+ [(_ for _ in ()).throw(AssertionError(f"Em-dash found in {p}")) for p in docs if "—" in p.read_text()]; \
95
+ readme = pathlib.Path("README.md").read_text(); \
96
+ links = re.findall(r"\]\(([^)#http][^)]*)\)", readme) + re.findall(r"src=\"([^\"]+)\"", readme); \
97
+ missing = [l for l in links if not pathlib.Path(l).exists()]; \
98
+ assert not missing, f"Missing links: {missing}"; \
99
+ print(f"Docs check passed ({len(docs)} markdown files, {len(links)} README links).")'
100
+
101
+ check-release: ## Validate release-please JSON/YAML and version parity
102
+ @$(PYTHON) -c 'import json, pathlib, re; \
103
+ cfg = json.loads(pathlib.Path("release-please-config.json").read_text()); \
104
+ manifest = json.loads(pathlib.Path(".release-please-manifest.json").read_text()); \
105
+ m_ver = manifest["."]; \
106
+ py_ver = re.search(r"^version\s*=\s*\"([^\"]+)\"", pathlib.Path("pyproject.toml").read_text(), re.M).group(1); \
107
+ init_ver = re.search(r"__version__\s*=\s*\"([^\"]+)\"", pathlib.Path("src/reels_wiki/__init__.py").read_text()).group(1); \
108
+ assert m_ver == py_ver == init_ver, f"Version mismatch: manifest={m_ver}, pyproject={py_ver}, __init__={init_ver}"; \
109
+ assert "packages" in cfg and "." in cfg["packages"]; \
110
+ print(f"Release config and version parity OK ({m_ver}).")'
111
+ @$(VENV_PYTHON) -c 'import yaml, pathlib; yaml.safe_load(pathlib.Path(".github/workflows/release-please.yml").read_text()); print("Workflow YAML syntax OK.")' 2>/dev/null || \
112
+ $(PYTHON) -c 'import yaml, pathlib; yaml.safe_load(pathlib.Path(".github/workflows/release-please.yml").read_text()); print("Workflow YAML syntax OK.")'
113
+
114
+ verify: check-docs check-release lint typecheck test-cov ## Run doc checks, release parity, lint, mypy, and coverage tests
115
+
116
+ # --- CLI Workflows
117
+ stats: ## Show queue statistics
118
+ $(REELS_SYNC) $(GLOBAL_FLAGS) stats
119
+
120
+ stats-json: ## Show queue statistics in JSON format
121
+ $(REELS_SYNC) $(GLOBAL_FLAGS) --json stats
122
+
123
+ ingest: ## Enqueue a single Reel URL (make ingest URL=<instagram_url>)
124
+ @test -n "$(URL)" || (echo "Usage: make ingest URL=<instagram_url>" && exit 1)
125
+ $(REELS_SYNC) $(GLOBAL_FLAGS) ingest "$(URL)"
126
+
127
+ import-ig: ## Import Instagram data export (make import-ig EXPORT_DIR=<path>)
128
+ @test -n "$(EXPORT_DIR)" || (echo "Usage: make import-ig EXPORT_DIR=<path>" && exit 1)
129
+ $(REELS_SYNC) $(GLOBAL_FLAGS) import-ig "$(EXPORT_DIR)"
130
+
131
+ process-dry: ## Preview pending queue items without running extraction or LLM calls
132
+ $(REELS_SYNC) $(GLOBAL_FLAGS) process --dry-run
133
+
134
+ process: ## Process pending queue items (LIMIT=$(LIMIT))
135
+ $(REELS_SYNC) $(GLOBAL_FLAGS) process --limit $(LIMIT)
136
+
137
+ retry-failed: ## Retry failed queue items (LIMIT=$(LIMIT))
138
+ $(REELS_SYNC) $(GLOBAL_FLAGS) process --retry-failed --limit $(LIMIT)
139
+
140
+ reprocess: ## Re-synthesize note from stored artifact (make reprocess SHORTCODE=<code>)
141
+ @test -n "$(SHORTCODE)" || (echo "Usage: make reprocess SHORTCODE=<code>" && exit 1)
142
+ $(REELS_SYNC) $(GLOBAL_FLAGS) reprocess "$(SHORTCODE)"
143
+
144
+ reprocess-all: ## Re-synthesize all stored artifacts
145
+ $(REELS_SYNC) $(GLOBAL_FLAGS) reprocess --all
146
+
147
+ telegram: ## Start the Telegram capture bot
148
+ $(REELS_SYNC) $(GLOBAL_FLAGS) telegram
149
+
150
+ mcp: ## Start the MCP server on stdio
151
+ $(REELS_SYNC) $(GLOBAL_FLAGS) mcp
152
+
153
+ # --- Build & Cleanup
154
+ build: $(VENV_PYTHON) ## Build sdist and wheel distributions into dist/
155
+ $(VENV_PYTHON) -m pip install --upgrade build
156
+ $(VENV_PYTHON) -m build
157
+
158
+ clean: ## Remove build artifacts and Python caches
159
+ rm -rf build/ dist/ *.egg-info .pytest_cache
160
+ find . -type d -name "__pycache__" -exec rm -rf {} +
161
+ find . -type f -name "*.pyc" -delete
162
+
163
+ clean-all: clean ## Remove build artifacts, caches, and $(VENV)
164
+ rm -rf $(VENV)