tweetnook 0.0.9__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 (127) hide show
  1. tweetnook-0.0.9/.gitignore +29 -0
  2. tweetnook-0.0.9/LICENSE +202 -0
  3. tweetnook-0.0.9/PKG-INFO +276 -0
  4. tweetnook-0.0.9/README.md +239 -0
  5. tweetnook-0.0.9/dev/web/.gitignore +1 -0
  6. tweetnook-0.0.9/dev/web/README.md +37 -0
  7. tweetnook-0.0.9/dev/web/alpine.LICENSE.md +21 -0
  8. tweetnook-0.0.9/dev/web/build.cjs +24 -0
  9. tweetnook-0.0.9/dev/web/input.css +3 -0
  10. tweetnook-0.0.9/dev/web/offline-smoke.cjs +133 -0
  11. tweetnook-0.0.9/dev/web/package-lock.json +1068 -0
  12. tweetnook-0.0.9/dev/web/package.json +13 -0
  13. tweetnook-0.0.9/dev/web/tailwind.config.cjs +6 -0
  14. tweetnook-0.0.9/docs/IMPLEMENTATION.md +1416 -0
  15. tweetnook-0.0.9/docs/PLAN.md +797 -0
  16. tweetnook-0.0.9/docs/PUBLISH.md +116 -0
  17. tweetnook-0.0.9/docs/README.md +33 -0
  18. tweetnook-0.0.9/docs/automated-tagging.md +230 -0
  19. tweetnook-0.0.9/docs/cli-reference.md +377 -0
  20. tweetnook-0.0.9/docs/configuration.md +293 -0
  21. tweetnook-0.0.9/docs/development/README.md +87 -0
  22. tweetnook-0.0.9/docs/development/architecture.md +233 -0
  23. tweetnook-0.0.9/docs/development/archive-import.md +204 -0
  24. tweetnook-0.0.9/docs/development/automated-tagging.md +259 -0
  25. tweetnook-0.0.9/docs/development/client-and-sync.md +215 -0
  26. tweetnook-0.0.9/docs/development/configuration-and-paths.md +228 -0
  27. tweetnook-0.0.9/docs/development/documentation-audit.md +159 -0
  28. tweetnook-0.0.9/docs/development/enrichment.md +203 -0
  29. tweetnook-0.0.9/docs/development/module-reference.md +160 -0
  30. tweetnook-0.0.9/docs/development/release.md +175 -0
  31. tweetnook-0.0.9/docs/development/scheduler.md +157 -0
  32. tweetnook-0.0.9/docs/development/search-and-web-api.md +262 -0
  33. tweetnook-0.0.9/docs/development/storage.md +226 -0
  34. tweetnook-0.0.9/docs/development/testing.md +238 -0
  35. tweetnook-0.0.9/docs/development/web-and-jobs.md +236 -0
  36. tweetnook-0.0.9/docs/enrichment.md +145 -0
  37. tweetnook-0.0.9/docs/getting-started.md +331 -0
  38. tweetnook-0.0.9/docs/importing.md +137 -0
  39. tweetnook-0.0.9/docs/maintenance.md +123 -0
  40. tweetnook-0.0.9/docs/search.md +163 -0
  41. tweetnook-0.0.9/docs/syncing.md +197 -0
  42. tweetnook-0.0.9/docs/tags.md +62 -0
  43. tweetnook-0.0.9/docs/troubleshooting.md +312 -0
  44. tweetnook-0.0.9/docs/web-app.md +192 -0
  45. tweetnook-0.0.9/pyproject.toml +94 -0
  46. tweetnook-0.0.9/tweetnook/__init__.py +5 -0
  47. tweetnook-0.0.9/tweetnook/__main__.py +4 -0
  48. tweetnook-0.0.9/tweetnook/activity_history.py +314 -0
  49. tweetnook-0.0.9/tweetnook/archive_import.py +2726 -0
  50. tweetnook-0.0.9/tweetnook/articles.py +249 -0
  51. tweetnook-0.0.9/tweetnook/auth/__init__.py +8 -0
  52. tweetnook-0.0.9/tweetnook/auth/cookies.py +73 -0
  53. tweetnook-0.0.9/tweetnook/automated_tagging.py +121 -0
  54. tweetnook-0.0.9/tweetnook/cli.py +1821 -0
  55. tweetnook-0.0.9/tweetnook/cli_service.py +197 -0
  56. tweetnook-0.0.9/tweetnook/cli_web.py +226 -0
  57. tweetnook-0.0.9/tweetnook/client/__init__.py +5 -0
  58. tweetnook-0.0.9/tweetnook/client/base.py +323 -0
  59. tweetnook-0.0.9/tweetnook/client/features.py +75 -0
  60. tweetnook-0.0.9/tweetnook/client/timelines.py +407 -0
  61. tweetnook-0.0.9/tweetnook/config.py +648 -0
  62. tweetnook-0.0.9/tweetnook/exceptions.py +55 -0
  63. tweetnook-0.0.9/tweetnook/export/__init__.py +5 -0
  64. tweetnook-0.0.9/tweetnook/export/common.py +41 -0
  65. tweetnook-0.0.9/tweetnook/export/json_export.py +28 -0
  66. tweetnook-0.0.9/tweetnook/extractor.py +977 -0
  67. tweetnook-0.0.9/tweetnook/gemini_accounting.py +963 -0
  68. tweetnook-0.0.9/tweetnook/gemini_pricing.py +340 -0
  69. tweetnook-0.0.9/tweetnook/interactive.py +68 -0
  70. tweetnook-0.0.9/tweetnook/job_supervisor.py +243 -0
  71. tweetnook-0.0.9/tweetnook/jobs.py +158 -0
  72. tweetnook-0.0.9/tweetnook/like_order.py +297 -0
  73. tweetnook-0.0.9/tweetnook/locking.py +67 -0
  74. tweetnook-0.0.9/tweetnook/media.py +400 -0
  75. tweetnook-0.0.9/tweetnook/pipeline.py +888 -0
  76. tweetnook-0.0.9/tweetnook/query_ids/__init__.py +7 -0
  77. tweetnook-0.0.9/tweetnook/query_ids/constants.py +28 -0
  78. tweetnook-0.0.9/tweetnook/query_ids/scraper.py +116 -0
  79. tweetnook-0.0.9/tweetnook/query_ids/store.py +62 -0
  80. tweetnook-0.0.9/tweetnook/reminders.py +54 -0
  81. tweetnook-0.0.9/tweetnook/resurrection.py +639 -0
  82. tweetnook-0.0.9/tweetnook/rpd.py +211 -0
  83. tweetnook-0.0.9/tweetnook/scheduler.py +312 -0
  84. tweetnook-0.0.9/tweetnook/search.py +1091 -0
  85. tweetnook-0.0.9/tweetnook/stats/__init__.py +31 -0
  86. tweetnook-0.0.9/tweetnook/stats/models.py +109 -0
  87. tweetnook-0.0.9/tweetnook/stats/render_cli.py +589 -0
  88. tweetnook-0.0.9/tweetnook/stats/service.py +887 -0
  89. tweetnook-0.0.9/tweetnook/storage/__init__.py +5 -0
  90. tweetnook-0.0.9/tweetnook/storage/backend.py +4761 -0
  91. tweetnook-0.0.9/tweetnook/storage/migrate.py +527 -0
  92. tweetnook-0.0.9/tweetnook/sync.py +1319 -0
  93. tweetnook-0.0.9/tweetnook/tagging.py +1734 -0
  94. tweetnook-0.0.9/tweetnook/tagging_prompts.py +240 -0
  95. tweetnook-0.0.9/tweetnook/threads.py +571 -0
  96. tweetnook-0.0.9/tweetnook/unfurl.py +298 -0
  97. tweetnook-0.0.9/tweetnook/utils.py +36 -0
  98. tweetnook-0.0.9/tweetnook/web/__init__.py +0 -0
  99. tweetnook-0.0.9/tweetnook/web/address.py +66 -0
  100. tweetnook-0.0.9/tweetnook/web/availability.py +466 -0
  101. tweetnook-0.0.9/tweetnook/web/deps.py +57 -0
  102. tweetnook-0.0.9/tweetnook/web/index.html +3254 -0
  103. tweetnook-0.0.9/tweetnook/web/notices.py +63 -0
  104. tweetnook-0.0.9/tweetnook/web/routes/__init__.py +1 -0
  105. tweetnook-0.0.9/tweetnook/web/routes/activity.py +298 -0
  106. tweetnook-0.0.9/tweetnook/web/routes/automated_tagging.py +237 -0
  107. tweetnook-0.0.9/tweetnook/web/routes/avatars.py +77 -0
  108. tweetnook-0.0.9/tweetnook/web/routes/config.py +97 -0
  109. tweetnook-0.0.9/tweetnook/web/routes/notices.py +22 -0
  110. tweetnook-0.0.9/tweetnook/web/routes/setup.py +316 -0
  111. tweetnook-0.0.9/tweetnook/web/routes/stats.py +199 -0
  112. tweetnook-0.0.9/tweetnook/web/routes/storage_stats.py +29 -0
  113. tweetnook-0.0.9/tweetnook/web/routes/tags.py +97 -0
  114. tweetnook-0.0.9/tweetnook/web/routes/tweets.py +523 -0
  115. tweetnook-0.0.9/tweetnook/web/server.py +289 -0
  116. tweetnook-0.0.9/tweetnook/web/setup_coordinator.py +332 -0
  117. tweetnook-0.0.9/tweetnook/web/static/css/styles.css +1691 -0
  118. tweetnook-0.0.9/tweetnook/web/static/css/tailwind.css +1 -0
  119. tweetnook-0.0.9/tweetnook/web/static/js/app.js +3361 -0
  120. tweetnook-0.0.9/tweetnook/web/static/js/autocomplete.js +574 -0
  121. tweetnook-0.0.9/tweetnook/web/static/js/themes.js +377 -0
  122. tweetnook-0.0.9/tweetnook/web/static/vendor/alpine.LICENSE.md +21 -0
  123. tweetnook-0.0.9/tweetnook/web/static/vendor/alpine.min.js +5 -0
  124. tweetnook-0.0.9/tweetnook/web/static/vendor/collapse.min.js +1 -0
  125. tweetnook-0.0.9/tweetnook/web/static/vendor/intersect.min.js +1 -0
  126. tweetnook-0.0.9/tweetnook/web/static/vendor/tailwind.LICENSE +21 -0
  127. tweetnook-0.0.9/tweetnook/web/stats_cache.py +177 -0
@@ -0,0 +1,29 @@
1
+ # Local data / outputs (never commit)
2
+ data/
3
+ .DS_Store
4
+
5
+ # Third-party snapshots are tracked but treated as read-only.
6
+ # Ignore untracked files under reference/ (build artifacts, caches, etc.).
7
+ reference/
8
+
9
+ # Credentials / sessions (never commit)
10
+ twitter_session.json
11
+ tweetnook_session.json
12
+ # Keep legacy session files protected after the application rename.
13
+ tweetxvault_session.json
14
+ *.sqlite
15
+ *.sqlite-wal
16
+ *.sqlite-shm
17
+ *.db
18
+
19
+ # Python
20
+ __pycache__/
21
+ *.py[cod]
22
+ .venv/
23
+ dist/
24
+ build/
25
+ *.egg-info/
26
+ .pytest_cache/
27
+ .mypy_cache/
28
+ .ruff_cache/
29
+ .coverage
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,276 @@
1
+ Metadata-Version: 2.5
2
+ Name: tweetnook
3
+ Version: 0.0.9
4
+ Summary: Self-hosted Web archive for Twitter/X bookmarks, likes, tweets, and official exports.
5
+ Project-URL: Homepage, https://github.com/gezerwezer/tweetnook
6
+ Project-URL: Repository, https://github.com/gezerwezer/tweetnook
7
+ Project-URL: Issues, https://github.com/gezerwezer/tweetnook/issues
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: archive,bookmarks,cli,tweets,twitter/x
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Utilities
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: fastapi<1,>=0.110
23
+ Requires-Dist: httpx<1,>=0.27
24
+ Requires-Dist: lancedb<0.35,>=0.34
25
+ Requires-Dist: loguru<1,>=0.7
26
+ Requires-Dist: platformdirs>=4.9.4
27
+ Requires-Dist: pyarrow<23,>=20
28
+ Requires-Dist: pydantic<3,>=2
29
+ Requires-Dist: rich<14,>=13
30
+ Requires-Dist: tqdm<5,>=4.66
31
+ Requires-Dist: typer<1,>=0.12
32
+ Requires-Dist: uvicorn<1,>=0.29
33
+ Provides-Extra: automated-tagging
34
+ Requires-Dist: google-genai<3,>=2.12.1; extra == 'automated-tagging'
35
+ Requires-Dist: pillow<12.0,>=10.0; extra == 'automated-tagging'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # TweetNook
39
+
40
+ TweetNook is a self-hosted archive for your Twitter/X bookmarks, likes, and tweets.
41
+ Run it on your own computer or server, import an archive downloaded from
42
+ Twitter/X, keep it updated with automated syncs, and browse everything in a Web UI from
43
+ your network. Search by words, author, date, or tag to find something you saved
44
+ without scrolling through your account.
45
+
46
+ ## Features
47
+
48
+ - **Archive your tweets:** save bookmarks, likes, and your own tweets, along with replies and quoted tweets
49
+ - **Import existing data:** bring in an official Twitter/X archive.
50
+ - **Browse in your browser:** read saved threads, view photos and videos, and
51
+ explore quoted tweets and articles.
52
+ - **Search and organize:** combine search filters, add your own tags, and edit
53
+ local descriptions.
54
+ - **Automated tagging:** with an optional add-on, you can use Gemini to suggest tags and describe media.
55
+ - **Keep it up to date:** run a sync from the web app or terminal, or schedule
56
+ regular syncs.
57
+ - **Unavailable-tweet recovery:** periodically recheck
58
+ for unavailable tweets that might return.
59
+ - **Export your collection:** save tweet data as JSON for use in other tools.
60
+
61
+ ## Project background
62
+
63
+ This project began as a fork of the [upstream project](https://github.com/lhl/tweetxvault),
64
+ which provides the foundation for this work. This version is developed independently.
65
+
66
+ Thanks to [rrika](https://github.com/rrika) for sharing their
67
+ [archive like-order research](https://github.com/lhl/tweetxvault/issues/2).
68
+
69
+ > [!NOTE]
70
+ > If you are upgrading from an older upstream installation that uses LanceDB, see the [migration instructions](docs/maintenance.md#upgrade-or-migrate-an-older-archive).
71
+
72
+ The original project provides the foundation for syncing, archive imports, media
73
+ downloads, thread expansion, article retrieval, and link previews. This fork is
74
+ developed independently and continues to build on that foundation.
75
+
76
+ ## Getting started
77
+
78
+ You need **macOS or Linux** and **Python 3.12 or newer**. Live syncing also needs
79
+ a browser signed in to your Twitter/X account. You can import a downloaded archive
80
+ without connecting to Twitter/X first.
81
+
82
+ ### 1. Install
83
+
84
+ Install TweetNook with pip:
85
+
86
+ ```bash
87
+ python3 -m pip install tweetnook
88
+ ````
89
+
90
+ To include automated tagging support:
91
+
92
+ ```bash
93
+ python3 -m pip install "tweetnook[automated-tagging]"
94
+ ```
95
+
96
+ ### 2. Install the service
97
+
98
+ For a persistent homelab/server installation, install TweetNook as a system service:
99
+
100
+ ```bash
101
+ sudo tweetnook service install
102
+ ```
103
+
104
+ This installs and enables the TweetNook service so it starts automatically at boot and keeps running in the background.
105
+
106
+ Check its status with:
107
+
108
+ ```bash
109
+ tweetnook service status
110
+ ```
111
+
112
+ You can also manage it with:
113
+
114
+ ```bash
115
+ sudo tweetnook service restart
116
+ sudo tweetnook service stop
117
+ sudo tweetnook service start
118
+ ```
119
+
120
+ ### 3. Open TweetNook
121
+
122
+ After the service starts, open the Web UI using the address shown by TweetNook, for example:
123
+
124
+ ```text
125
+ http://192.168.1.50:8000
126
+ ```
127
+
128
+ On first launch, the Web UI will guide you through setup.
129
+
130
+
131
+ ## Everyday use
132
+
133
+ ### Keep your archive up to date
134
+
135
+ Run `tweetnook sync` again whenever you want to save new bookmarks and likes.
136
+ To automate it, open **Settings → Schedule**, choose when to run, and save.
137
+ The TweetNook server/service must stay running for scheduled syncs to work;
138
+ the browser can be closed. Your own tweets still use the separate
139
+ `tweetnook sync tweets` command.
140
+
141
+ | Task | Command |
142
+ |---|---|
143
+ | Save bookmarks only | `tweetnook sync bookmarks` |
144
+ | Save likes only | `tweetnook sync likes` |
145
+ | Continue collecting older history | `tweetnook sync --backfill` |
146
+ | Limit collection to five pages each | `tweetnook sync --limit 5` |
147
+ | Skip media downloads for this sync | `tweetnook sync --skip-media` |
148
+ | View archive counts and progress | `tweetnook stats` |
149
+ | Browse the latest saved tweets in the terminal | `tweetnook view all --limit 20` |
150
+
151
+ A sync page normally contains up to 20 tweets; `--limit` counts pages, not tweets.
152
+ The limit does not bound all follow-up work. Run one archive job at a time and
153
+ read the final summary for any downloads or lookups that need another attempt.
154
+
155
+ Use **Stop Task** in the web app or **Ctrl+C** in the terminal to interrupt a job.
156
+ Wait for it to finish stopping before starting another. Stopping TweetNook also asks its active Web or scheduled job to stop gracefully,
157
+ preserving already committed work.
158
+
159
+ ### Search saved tweets
160
+
161
+ Type words and filters together in the web app's search box:
162
+
163
+ | Find… | Query |
164
+ |---|---|
165
+ | An exact phrase | `"night sky"` |
166
+ | Images from an author | `from:alice has:image` |
167
+ | Tweets from January 2026 | `since:2026-01-01 until:2026-02-01` |
168
+ | A local tag | `tag:"read later"` |
169
+ | Links, excluding reposts | `has:links -is:retweet` |
170
+
171
+ The same queries work in the terminal:
172
+
173
+ ```bash
174
+ tweetnook search '"night sky" has:image' --sort newest --limit 20
175
+ ```
176
+
177
+ Dates use UTC, and `until` excludes the date entered. See
178
+ [Search](docs/search.md) for all filters and search limits.
179
+
180
+ ### Add tags
181
+
182
+ Open a tweet's menu in the web app to add tags or a description. Click a tag to
183
+ find related tweets. **Settings → Tags** lets you merge or delete tags across
184
+ your archive.
185
+
186
+ ### Fill in missing details
187
+
188
+ Normal sync handles follow-up work automatically. You can also run individual
189
+ jobs when you need them:
190
+
191
+ ```bash
192
+ tweetnook import enrich
193
+ tweetnook threads expand
194
+ tweetnook media download --retry-failed
195
+ ```
196
+
197
+ These commands fill in eligible missing details, expand saved conversations, and
198
+ retry media downloads. Run only the jobs you need. See
199
+ [Enrichment](docs/enrichment.md) for articles and link previews too.
200
+
201
+ ## Optional Gemini tagging
202
+
203
+ Gemini can suggest tags for text and media tweets and add media descriptions.
204
+ To install support in the active pip environment:
205
+
206
+ ```bash
207
+ python -m pip install "tweetnook[automated-tagging]"
208
+ ```
209
+
210
+ Restart the TweetNook server afterward. For a systemd installation, use the
211
+ service restart command; for a foreground `tweetnook serve` process, stop and
212
+ start it again. Developers using uv can install the extra once with
213
+ `uv sync --extra automated-tagging`. No runtime `--extra` flag is needed.
214
+
215
+ Open **Settings → Automated Tagging**, enable the controls, enter your Gemini API
216
+ key, choose a model and Free or Paid mode, and set the usage limits. Try one
217
+ archived tweet with **Test run**, then save when you want tagging enabled.
218
+
219
+ Once saved and enabled, tagging runs after sync. To tag existing eligible tweets
220
+ without syncing:
221
+
222
+ ```bash
223
+ tweetnook tag
224
+ ```
225
+
226
+ Tagging sends selected content to Google. Test runs also use real requests and
227
+ can consume quota or incur charges, though they do not save generated tags.
228
+ Read [Automated tagging](docs/automated-tagging.md) for setup, privacy,
229
+ and spend controls.
230
+
231
+ ## Your files and backups
232
+
233
+ | System | Default data folder |
234
+ |---|---|
235
+ | macOS | `~/Library/Application Support/tweetnook` |
236
+ | Linux | `~/.local/share/tweetnook` |
237
+
238
+ The folder contains the archive database, downloaded media, tags, and activity
239
+ history. [Configuration](docs/configuration.md#resolved-directories)
240
+ explains custom locations.
241
+
242
+ To back up, stop the app and all archive jobs, then copy the **complete data
243
+ folder** and your configuration. Keep original Twitter/X downloads separately.
244
+ [Backups and maintenance](docs/maintenance.md) covers restoring
245
+ and checking a backup.
246
+
247
+ To export tweet data for analysis or another tool:
248
+
249
+ ```bash
250
+ tweetnook export json --out my-tweets.json
251
+ ```
252
+
253
+ JSON exports do not include media files or everything needed to restore an
254
+ archive. Use a full folder backup for recovery.
255
+
256
+
257
+ ## Documentation and help
258
+
259
+ Use `tweetnook --help` to list commands or add `--help` to a command, such as
260
+ `tweetnook sync --help`.
261
+
262
+ | Guide | Covers |
263
+ |---|---|
264
+ | [User guide](docs/README.md) | All feature guides and references |
265
+ | [Syncing](docs/syncing.md) | Older history, resuming work, and sync options |
266
+ | [Web app](docs/web-app.md) | Browsing, settings, schedules, and activity |
267
+ | [Importing](docs/importing.md) | Official Twitter/X archives |
268
+ | [Configuration](docs/configuration.md) | Settings, defaults, and file locations |
269
+ | [CLI reference](docs/cli-reference.md) | Commands and options |
270
+ | [Troubleshooting](docs/troubleshooting.md) | Common errors and next steps |
271
+ | [Development guide](docs/development/README.md) | Architecture, tests, and contribution workflow |
272
+
273
+ ## License
274
+
275
+ [Apache License 2.0](LICENSE). See [upstream](https://github.com/lhl/tweetxvault)
276
+ for the original project.