kiosque 0.2.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 (86) hide show
  1. kiosque-0.2.0/.github/workflows/ci.yml +40 -0
  2. kiosque-0.2.0/.github/workflows/docs.yml +46 -0
  3. kiosque-0.2.0/.github/workflows/release.yml +132 -0
  4. kiosque-0.2.0/.gitignore +100 -0
  5. kiosque-0.2.0/PKG-INFO +173 -0
  6. kiosque-0.2.0/agents.md +28 -0
  7. kiosque-0.2.0/docs/development/architecture.md +415 -0
  8. kiosque-0.2.0/docs/development/contributing.md +605 -0
  9. kiosque-0.2.0/docs/features/article-extraction.md +213 -0
  10. kiosque-0.2.0/docs/features/bookmark-management.md +472 -0
  11. kiosque-0.2.0/docs/features/tui-guide.md +389 -0
  12. kiosque-0.2.0/docs/features/tui-screenshot.svg +163 -0
  13. kiosque-0.2.0/docs/getting-started/configuration.md +243 -0
  14. kiosque-0.2.0/docs/getting-started/installation.md +136 -0
  15. kiosque-0.2.0/docs/index.md +185 -0
  16. kiosque-0.2.0/docs/integrations/github.md +196 -0
  17. kiosque-0.2.0/docs/integrations/raindrop.md +236 -0
  18. kiosque-0.2.0/docs/troubleshooting.md +665 -0
  19. kiosque-0.2.0/docs/websites/adding-sites.md +114 -0
  20. kiosque-0.2.0/docs/websites/authentication.md +230 -0
  21. kiosque-0.2.0/docs/websites/nyt-cookie-setup.md +131 -0
  22. kiosque-0.2.0/docs/websites/supported-sites.md +53 -0
  23. kiosque-0.2.0/kiosque/__init__.py +182 -0
  24. kiosque-0.2.0/kiosque/__main__.py +17 -0
  25. kiosque-0.2.0/kiosque/api/__init__.py +0 -0
  26. kiosque-0.2.0/kiosque/api/github.py +236 -0
  27. kiosque-0.2.0/kiosque/api/pocket.py +133 -0
  28. kiosque-0.2.0/kiosque/api/raindrop.py +208 -0
  29. kiosque-0.2.0/kiosque/core/__init__.py +0 -0
  30. kiosque-0.2.0/kiosque/core/client.py +137 -0
  31. kiosque-0.2.0/kiosque/core/config.py +246 -0
  32. kiosque-0.2.0/kiosque/core/website.py +483 -0
  33. kiosque-0.2.0/kiosque/tui/__init__.py +0 -0
  34. kiosque-0.2.0/kiosque/tui/github.py +129 -0
  35. kiosque-0.2.0/kiosque/tui/kiosque.tcss +117 -0
  36. kiosque-0.2.0/kiosque/tui/raindrop.py +249 -0
  37. kiosque-0.2.0/kiosque/tui/tui.py +645 -0
  38. kiosque-0.2.0/kiosque/website/01net.py +10 -0
  39. kiosque-0.2.0/kiosque/website/__init__.py +0 -0
  40. kiosque-0.2.0/kiosque/website/asahi.py +24 -0
  41. kiosque-0.2.0/kiosque/website/aviationweek.py +149 -0
  42. kiosque-0.2.0/kiosque/website/courrierinternational.py +99 -0
  43. kiosque-0.2.0/kiosque/website/franceculture.py +26 -0
  44. kiosque-0.2.0/kiosque/website/francetvinfo.py +19 -0
  45. kiosque-0.2.0/kiosque/website/ft.py +9 -0
  46. kiosque-0.2.0/kiosque/website/ladepeche.py +22 -0
  47. kiosque-0.2.0/kiosque/website/latimes.py +24 -0
  48. kiosque-0.2.0/kiosque/website/lefigaro.py +20 -0
  49. kiosque-0.2.0/kiosque/website/lemonde.py +105 -0
  50. kiosque-0.2.0/kiosque/website/lesechos.py +74 -0
  51. kiosque-0.2.0/kiosque/website/letemps.py +21 -0
  52. kiosque-0.2.0/kiosque/website/mediapart.py +40 -0
  53. kiosque-0.2.0/kiosque/website/mondediplomatique.py +93 -0
  54. kiosque-0.2.0/kiosque/website/nationalgeographic.py +30 -0
  55. kiosque-0.2.0/kiosque/website/nbcnews.py +24 -0
  56. kiosque-0.2.0/kiosque/website/newyorker.py +33 -0
  57. kiosque-0.2.0/kiosque/website/nikkei.py +19 -0
  58. kiosque-0.2.0/kiosque/website/nytimes.py +167 -0
  59. kiosque-0.2.0/kiosque/website/policito.py +56 -0
  60. kiosque-0.2.0/kiosque/website/pourlascience.py +74 -0
  61. kiosque-0.2.0/kiosque/website/quantamagazine.py +20 -0
  62. kiosque-0.2.0/kiosque/website/reporterre.py +39 -0
  63. kiosque-0.2.0/kiosque/website/rugbyrama.py +31 -0
  64. kiosque-0.2.0/kiosque/website/telerama.py +10 -0
  65. kiosque-0.2.0/kiosque/website/theatlantic.py +18 -0
  66. kiosque-0.2.0/kiosque/website/theconversation.py +15 -0
  67. kiosque-0.2.0/kiosque/website/theguardian.py +15 -0
  68. kiosque-0.2.0/kiosque/website/twitter.py +163 -0
  69. kiosque-0.2.0/kiosque/website/usinenouvelle.py +145 -0
  70. kiosque-0.2.0/kiosque/website/washingtonpost.py +30 -0
  71. kiosque-0.2.0/kiosque/website/yomiuri.py +12 -0
  72. kiosque-0.2.0/kiosque.code-workspace +76 -0
  73. kiosque-0.2.0/license.txt +21 -0
  74. kiosque-0.2.0/mkdocs.yml +81 -0
  75. kiosque-0.2.0/pyproject.toml +75 -0
  76. kiosque-0.2.0/read_article.sh +60 -0
  77. kiosque-0.2.0/readme.md +141 -0
  78. kiosque-0.2.0/tests/__init__.py +1 -0
  79. kiosque-0.2.0/tests/test_config.py +55 -0
  80. kiosque-0.2.0/tests/test_login.py +121 -0
  81. kiosque-0.2.0/tests/test_proxy.py +144 -0
  82. kiosque-0.2.0/tests/test_raindrop.py +66 -0
  83. kiosque-0.2.0/tests/test_resolve.py +67 -0
  84. kiosque-0.2.0/tests/test_website.py +86 -0
  85. kiosque-0.2.0/uv.lock +2038 -0
  86. kiosque-0.2.0/websites.md +53 -0
@@ -0,0 +1,40 @@
1
+ name: Code Quality
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ with:
24
+ enable-cache: true
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --dev
28
+
29
+ - name: Run ruff check
30
+ run: uv run ruff check .
31
+
32
+ - name: Run ruff format check
33
+ run: uv run ruff format --check .
34
+
35
+ - name: Run ty type checking
36
+ run: uvx ty check kiosque/
37
+ continue-on-error: true
38
+
39
+ - name: Run tests (excluding login tests)
40
+ run: uv run pytest -v -m "not login"
@@ -0,0 +1,46 @@
1
+ name: Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+ paths:
9
+ - "docs/**"
10
+ - "mkdocs.yml"
11
+ - ".github/workflows/docs.yml"
12
+ workflow_dispatch: # Allow manual triggers
13
+
14
+ permissions:
15
+ contents: write
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0 # Fetch all history for git info
25
+
26
+ - name: Setup Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.12"
30
+
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@v5
33
+ with:
34
+ enable-cache: true
35
+
36
+ - name: Install dependencies
37
+ run: |
38
+ uv pip install --system mkdocs-material
39
+
40
+ - name: Configure Git
41
+ run: |
42
+ git config user.name "github-actions[bot]"
43
+ git config user.email "github-actions[bot]@users.noreply.github.com"
44
+
45
+ - name: Deploy to GitHub Pages
46
+ run: mkdocs gh-deploy --force
@@ -0,0 +1,132 @@
1
+ name: Build and Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*" # Triggers on version tags like v0.1.0, v1.2.3, etc.
7
+ workflow_dispatch: # Allow manual triggers
8
+
9
+ permissions:
10
+ contents: write # Needed for creating GitHub releases
11
+ id-token: write # Needed for PyPI trusted publishing
12
+
13
+ jobs:
14
+ quality-check:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v4
26
+ with:
27
+ enable-cache: true
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --dev
31
+
32
+ - name: Run ruff check
33
+ run: uv run ruff check .
34
+
35
+ - name: Run ruff format check
36
+ run: uv run ruff format --check .
37
+
38
+ - name: Run type checking
39
+ run: uvx ty check kiosque/
40
+ continue-on-error: true
41
+
42
+ - name: Run tests (excluding login tests)
43
+ run: uv run pytest -v -m "not login"
44
+
45
+ build:
46
+ needs: quality-check
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v5
53
+ with:
54
+ python-version: "3.12"
55
+
56
+ - name: Install uv
57
+ uses: astral-sh/setup-uv@v4
58
+ with:
59
+ enable-cache: true
60
+
61
+ - name: Build package
62
+ run: uv build
63
+
64
+ - name: Upload build artifacts
65
+ uses: actions/upload-artifact@v4
66
+ with:
67
+ name: dist
68
+ path: dist/
69
+
70
+ publish-pypi:
71
+ needs: build
72
+ runs-on: ubuntu-latest
73
+ if: startsWith(github.ref, 'refs/tags/v')
74
+ environment:
75
+ name: pypi
76
+ url: https://pypi.org/p/kiosque
77
+ steps:
78
+ - name: Download build artifacts
79
+ uses: actions/download-artifact@v4
80
+ with:
81
+ name: dist
82
+ path: dist/
83
+
84
+ - name: Publish to PyPI
85
+ uses: pypa/gh-action-pypi-publish@release/v1
86
+
87
+ create-release:
88
+ needs: publish-pypi
89
+ runs-on: ubuntu-latest
90
+ if: startsWith(github.ref, 'refs/tags/v')
91
+ steps:
92
+ - uses: actions/checkout@v4
93
+ with:
94
+ fetch-depth: 0
95
+
96
+ - name: Extract version from tag
97
+ id: version
98
+ run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
99
+
100
+ - name: Generate release notes
101
+ id: notes
102
+ run: |
103
+ # Get the previous tag
104
+ PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
105
+
106
+ # Generate changelog from commits since last tag
107
+ echo "notes<<EOF" >> $GITHUB_OUTPUT
108
+ echo "## What's Changed" >> $GITHUB_OUTPUT
109
+ echo "" >> $GITHUB_OUTPUT
110
+ git log $PREV_TAG..HEAD --pretty=format:"- %s (%h)" --no-merges >> $GITHUB_OUTPUT
111
+ echo "" >> $GITHUB_OUTPUT
112
+ echo "" >> $GITHUB_OUTPUT
113
+ echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREV_TAG...${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
114
+ echo "EOF" >> $GITHUB_OUTPUT
115
+
116
+ - name: Download build artifacts
117
+ uses: actions/download-artifact@v4
118
+ with:
119
+ name: dist
120
+ path: dist/
121
+
122
+ - name: Create GitHub Release
123
+ uses: softprops/action-gh-release@v1
124
+ with:
125
+ name: Release v${{ steps.version.outputs.version }}
126
+ body: ${{ steps.notes.outputs.notes }}
127
+ draft: false
128
+ prerelease: false
129
+ files: |
130
+ dist/*
131
+ env:
132
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,100 @@
1
+ # Local test/config files
2
+ kiosque.conf
3
+ plan.md
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+ db.sqlite3-journal
61
+
62
+ # Jupyter Notebook
63
+ .ipynb_checkpoints
64
+
65
+ # pyenv
66
+ .python-version
67
+
68
+ # Environments
69
+ .env
70
+ .venv
71
+ env/
72
+ venv/
73
+ ENV/
74
+ env.bak/
75
+ venv.bak/
76
+
77
+ # mkdocs documentation
78
+ /site
79
+
80
+ # mypy
81
+ .mypy_cache/
82
+ .dmypy.json
83
+ dmypy.json
84
+
85
+ # IDEs
86
+ .vscode/
87
+ .idea/
88
+ *.swp
89
+ *.swo
90
+ *~
91
+
92
+ # OS
93
+ .DS_Store
94
+ Thumbs.db
95
+
96
+ # Project specific
97
+ systemd/
98
+ _ignore/
99
+ Icon
100
+ site/
kiosque-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: kiosque
3
+ Version: 0.2.0
4
+ Summary: Save newspaper articles in textual format
5
+ Author-email: Xavier Olive <git@xoolive.org>
6
+ License-Expression: MIT
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Intended Audience :: Information Technology
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: MacOS
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: appdirs>=1.4.4
21
+ Requires-Dist: bs4>=0.0.2
22
+ Requires-Dist: click>=8.1.7
23
+ Requires-Dist: httpx-socks>=0.9.2
24
+ Requires-Dist: httpx>=0.27.2
25
+ Requires-Dist: lxml>=5.3.0
26
+ Requires-Dist: pydantic>=2.11.5
27
+ Requires-Dist: pypandoc>=1.13
28
+ Requires-Dist: pyperclip>=1.9.0
29
+ Requires-Dist: stamina>=24.3.0
30
+ Requires-Dist: textual>=0.81.0
31
+ Description-Content-Type: text/markdown
32
+
33
+ # kiosque
34
+
35
+ A unified tool for news article extraction and bookmark management.
36
+
37
+ ## What is Kiosque?
38
+
39
+ Kiosque combines three essential capabilities:
40
+
41
+ 1. **Article Extractor (CLI/API)** - Download full-text articles from several paywalled news websites as Markdown
42
+ 2. **Bookmark Manager (TUI)** - Browse and manage bookmarks from Raindrop.io and GitHub Stars in a beautiful terminal interface
43
+ 3. **Content Aggregator** - Unified tabbed interface for multiple content sources with smart context-aware actions
44
+
45
+ ## Quick Start
46
+
47
+ ```bash
48
+ # Launch TUI (Terminal User Interface) - default
49
+ kiosque
50
+
51
+ # Extract article to file
52
+ kiosque https://www.lemonde.fr/article output.md
53
+
54
+ # Print to stdout
55
+ kiosque https://www.nytimes.com/article - | bat - -l md
56
+
57
+ # Download NYT front page PDF
58
+ kiosque nyt
59
+ ```
60
+
61
+ ## Installation
62
+
63
+ ```bash
64
+ # From PyPI
65
+ pip install kiosque
66
+
67
+ # Or with uv (recommended)
68
+ uv tool install kiosque
69
+ ```
70
+
71
+ **Requirements:** Python 3.12+, pandoc
72
+
73
+ ## Core Features
74
+
75
+ ### 📰 Article Extraction
76
+
77
+ - **News Websites** - Le Monde, NYT, Guardian, Mediapart, and more
78
+ - **Authentication** - Login support for paywalled sites
79
+ - **Markdown Output** - Clean, readable format with metadata
80
+ - **Proxy Support** - Access geo-blocked websites via SOCKS/HTTP proxies
81
+
82
+ ### 🔖 Bookmark Management
83
+
84
+ - **Raindrop.io Integration** - Browse, preview, archive, delete, edit tags
85
+ - **GitHub Stars** - Explore starred repos, preview READMEs, unstar
86
+ - **Unified Search** - Filter by title, URL, tags, topics across all sources
87
+ - **Beautiful Previews** - Markdown rendering with syntax highlighting
88
+
89
+ ### 🚀 Content Aggregation
90
+
91
+ - **Tabbed Interface** - Switch between Raindrop and GitHub
92
+ - **Progressive Loading** - Non-blocking, fast performance
93
+ - **Smart Actions** - Context-aware keybindings (e.g., star GitHub repos from Raindrop)
94
+
95
+ ## Configuration
96
+
97
+ Create `~/.config/kiosque/kiosque.conf`:
98
+
99
+ ```ini
100
+ # Website authentication
101
+ [https://www.lemonde.fr/]
102
+ username = your.email@example.com
103
+ password = your_password
104
+
105
+ [https://www.nytimes.com/]
106
+ cookie_nyt_s = your_nyt_cookie_value
107
+
108
+ # Raindrop.io integration
109
+ [raindrop.io]
110
+ token = your_raindrop_api_token
111
+
112
+ # GitHub Stars integration
113
+ [github]
114
+ token = ghp_your_github_personal_access_token
115
+
116
+ # Proxy for geo-blocked sites (optional)
117
+ [proxy]
118
+ url = socks5://localhost:1080
119
+ ```
120
+
121
+ ## Python API
122
+
123
+ ```python
124
+ from kiosque import Website
125
+
126
+ # Extract article as Markdown
127
+ url = "https://www.lemonde.fr/article"
128
+ markdown = Website.instance(url).full_text(url)
129
+
130
+ # Save to file
131
+ Website.instance(url).save(url, "article.md")
132
+ ```
133
+
134
+ ## Documentation
135
+
136
+ 📚 **Full documentation:** https://www.xoolive.org/kiosque
137
+
138
+ - [Installation](https://www.xoolive.org/kiosque/getting-started/installation/) - Detailed installation guide
139
+ - [Configuration](https://www.xoolive.org/kiosque/getting-started/configuration/) - Authentication setup for all sites
140
+ - [TUI Guide](https://www.xoolive.org/kiosque/features/tui-guide/) - Complete terminal interface reference
141
+ - [Supported Sites](https://www.xoolive.org/kiosque/websites/supported-sites/) - Full list of websites
142
+ - [Authentication](https://www.xoolive.org/kiosque/websites/authentication/) - Site-specific login instructions
143
+ - [Adding Sites](https://www.xoolive.org/kiosque/websites/adding-sites/) - Contributing new website support
144
+ - [Troubleshooting](https://www.xoolive.org/kiosque/troubleshooting/) - Common issues and solutions
145
+
146
+ ## TUI Keybindings
147
+
148
+ | Key | Action |
149
+ | ----------------------- | ---------------------------- |
150
+ | `↑` or `k` / `↓` or `j` | Navigate entries |
151
+ | `1` / `2` | Switch tabs |
152
+ | `/` | Search |
153
+ | `Space` | Preview article/README |
154
+ | `Enter` / `o` | Open in browser |
155
+ | `t` | Edit tags (Raindrop) |
156
+ | `e` | Archive (Raindrop) |
157
+ | `d` | Delete (Raindrop) |
158
+ | `u` | Unstar (GitHub) |
159
+ | `s` | Star on GitHub (GitHub URLs) |
160
+ | `r` | Refresh |
161
+ | `q` | Quit |
162
+
163
+ ## Contributing
164
+
165
+ Contributions welcome! See the [Contributing Guide](https://www.xoolive.org/kiosque/development/contributing/) for:
166
+
167
+ - How to add support for new websites
168
+ - Code style and testing guidelines
169
+ - Architecture overview
170
+
171
+ ## License
172
+
173
+ MIT
@@ -0,0 +1,28 @@
1
+ # Agent development guide
2
+
3
+ ## Setup commands
4
+
5
+ - Run `uv sync --dev`
6
+
7
+ ## Coding style
8
+
9
+ - Run `uv run ruff check` and `uv run ruff format` to check and format code
10
+ - Run `uvx ty check kiosque/ tests/` to check types
11
+ - Use `prettier` to format markdown files
12
+
13
+ ## Commit rules
14
+
15
+ - **NEVER COMMIT ANYTHING WITHOUT EXPLICIT APPROVAL**: encourage the developer to check the code before committing
16
+ - **DO NOT COMMIT DIRECTLY TO THE MAIN BRANCH**
17
+ - Create a feature branch from main for your changes
18
+
19
+ ## Project structure
20
+
21
+ - kiosque/core/ - Core functionality (client, website base class, config)
22
+ - kiosque/website/ - Individual website scrapers (30+ files)
23
+ - kiosque/api/ - API integrations (Raindrop.io, Pocket - deprecated)
24
+ - kiosque/tui/ - Terminal UI with Textual
25
+
26
+ ## Agent coding
27
+
28
+ - If there is a file where the plan is written stored, update it after every step