cullet 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 (65) hide show
  1. cullet-0.1.0/LICENSE +201 -0
  2. cullet-0.1.0/PKG-INFO +127 -0
  3. cullet-0.1.0/README.md +88 -0
  4. cullet-0.1.0/pyproject.toml +110 -0
  5. cullet-0.1.0/requirements.txt +6 -0
  6. cullet-0.1.0/setup.cfg +4 -0
  7. cullet-0.1.0/src/cullet/__init__.py +1 -0
  8. cullet-0.1.0/src/cullet/__main__.py +3 -0
  9. cullet-0.1.0/src/cullet/actions.py +222 -0
  10. cullet-0.1.0/src/cullet/cli.py +138 -0
  11. cullet-0.1.0/src/cullet/cli_dedup_images.py +103 -0
  12. cullet-0.1.0/src/cullet/cli_dedup_videos.py +288 -0
  13. cullet-0.1.0/src/cullet/cli_downscale_images.py +386 -0
  14. cullet-0.1.0/src/cullet/cli_downscale_videos.py +278 -0
  15. cullet-0.1.0/src/cullet/cli_fix_rotation_images.py +392 -0
  16. cullet-0.1.0/src/cullet/cli_fix_rotation_videos.py +375 -0
  17. cullet-0.1.0/src/cullet/dedup/__init__.py +0 -0
  18. cullet-0.1.0/src/cullet/dedup/common.py +152 -0
  19. cullet-0.1.0/src/cullet/dedup/image_groups.py +148 -0
  20. cullet-0.1.0/src/cullet/dedup/images.py +208 -0
  21. cullet-0.1.0/src/cullet/dedup/sscd.py +85 -0
  22. cullet-0.1.0/src/cullet/dedup_review.py +103 -0
  23. cullet-0.1.0/src/cullet/extras.py +38 -0
  24. cullet-0.1.0/src/cullet/file_ops.py +172 -0
  25. cullet-0.1.0/src/cullet/files.py +150 -0
  26. cullet-0.1.0/src/cullet/folder_model.py +84 -0
  27. cullet-0.1.0/src/cullet/image_cache.py +168 -0
  28. cullet-0.1.0/src/cullet/image_io.py +258 -0
  29. cullet-0.1.0/src/cullet/image_view.py +286 -0
  30. cullet-0.1.0/src/cullet/images.py +762 -0
  31. cullet-0.1.0/src/cullet/keymap.py +111 -0
  32. cullet-0.1.0/src/cullet/log_panel.py +23 -0
  33. cullet-0.1.0/src/cullet/logs.py +19 -0
  34. cullet-0.1.0/src/cullet/main_window.py +605 -0
  35. cullet-0.1.0/src/cullet/overlays.py +123 -0
  36. cullet-0.1.0/src/cullet/paths.py +42 -0
  37. cullet-0.1.0/src/cullet/rename_dialog.py +38 -0
  38. cullet-0.1.0/src/cullet/rotation.py +225 -0
  39. cullet-0.1.0/src/cullet/thumb_store.py +90 -0
  40. cullet-0.1.0/src/cullet/thumbnails.py +265 -0
  41. cullet-0.1.0/src/cullet/video.py +542 -0
  42. cullet-0.1.0/src/cullet.egg-info/PKG-INFO +127 -0
  43. cullet-0.1.0/src/cullet.egg-info/SOURCES.txt +63 -0
  44. cullet-0.1.0/src/cullet.egg-info/dependency_links.txt +1 -0
  45. cullet-0.1.0/src/cullet.egg-info/entry_points.txt +8 -0
  46. cullet-0.1.0/src/cullet.egg-info/requires.txt +18 -0
  47. cullet-0.1.0/src/cullet.egg-info/top_level.txt +1 -0
  48. cullet-0.1.0/src/cullet.egg-info/zip-safe +1 -0
  49. cullet-0.1.0/tests/test_cli_downscale_images.py +25 -0
  50. cullet-0.1.0/tests/test_cli_fix_rotation_videos.py +177 -0
  51. cullet-0.1.0/tests/test_dedup_image_groups.py +47 -0
  52. cullet-0.1.0/tests/test_dedup_images.py +38 -0
  53. cullet-0.1.0/tests/test_dedup_review.py +53 -0
  54. cullet-0.1.0/tests/test_extras.py +22 -0
  55. cullet-0.1.0/tests/test_file_ops.py +264 -0
  56. cullet-0.1.0/tests/test_files.py +79 -0
  57. cullet-0.1.0/tests/test_fix_rotation_votes.py +60 -0
  58. cullet-0.1.0/tests/test_folder_model.py +49 -0
  59. cullet-0.1.0/tests/test_gui.py +261 -0
  60. cullet-0.1.0/tests/test_image_io.py +155 -0
  61. cullet-0.1.0/tests/test_images_clean_exif.py +389 -0
  62. cullet-0.1.0/tests/test_images_multi_frame.py +231 -0
  63. cullet-0.1.0/tests/test_keymap.py +40 -0
  64. cullet-0.1.0/tests/test_rotation.py +70 -0
  65. cullet-0.1.0/tests/test_video.py +470 -0
cullet-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2023 simon-ging
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
cullet-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: cullet
3
+ Version: 0.1.0
4
+ Summary: Keyboard-driven photo viewer for culling, sorting, tagging and deduplicating.
5
+ Author: simon-ging
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Project-URL, https://github.com/simon-ging/cullet
8
+ Keywords: photo,image,viewer,culling,duplicates
9
+ Platform: any
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: X11 Applications :: Qt
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Topic :: Multimedia :: Graphics :: Viewers
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: PySide6
23
+ Requires-Dist: Pillow
24
+ Requires-Dist: natsort
25
+ Requires-Dist: typedparser
26
+ Requires-Dist: pathspec>=1.0
27
+ Requires-Dist: filetype
28
+ Provides-Extra: full
29
+ Requires-Dist: torch; extra == "full"
30
+ Requires-Dist: torchvision; extra == "full"
31
+ Requires-Dist: tqdm; extra == "full"
32
+ Requires-Dist: numpy; extra == "full"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest; extra == "dev"
35
+ Requires-Dist: pytest-cov; extra == "dev"
36
+ Requires-Dist: pylint; extra == "dev"
37
+ Requires-Dist: numpy; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ # cullet
41
+
42
+ <p align="center">
43
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py310.yml">
44
+ <img alt="minimal build 3.10 status" title="minimal build 3.10 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py310.yml?branch=main&label=minimal%20build%203.10" />
45
+ </a>
46
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py314.yml">
47
+ <img alt="minimal build 3.14 status" title="minimal build 3.14 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py314.yml?branch=main&label=minimal%20build%203.14" />
48
+ </a>
49
+ <br />
50
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py310-full.yml">
51
+ <img alt="full build 3.10 status" title="full build 3.10 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py310-full.yml?branch=main&label=full%20build%203.10" />
52
+ </a>
53
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py314-full.yml">
54
+ <img alt="full build 3.14 status" title="full build 3.14 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py314-full.yml?branch=main&label=full%20build%203.14" />
55
+ </a>
56
+ <br />
57
+ <img alt="coverage" title="coverage" src="https://raw.githubusercontent.com/simon-ging/cullet/main/docs/coverage.svg" />
58
+ <a href="https://pypi.org/project/cullet/">
59
+ <img alt="version" title="version" src="https://img.shields.io/pypi/v/cullet?color=success" />
60
+ </a>
61
+ </p>
62
+
63
+ Keyboard-driven photo viewer for going through a folder fast: step, zoom, rotate, delete, move
64
+ into target folders, tag, and review duplicates. Press `h` in the viewer for the keys.
65
+
66
+ ## Install
67
+
68
+ Requires `python>=3.10`
69
+
70
+ ```bash
71
+ uv tool install cullet
72
+ ```
73
+
74
+ or `pip install cullet` into an environment of your choice. Rotating JPEGs losslessly needs the
75
+ `jpegtran` binary, which comes with `libjpeg-turbo` on most distributions.
76
+
77
+ Finding duplicates and fixing rotations need torch, which comes with the full extra:
78
+
79
+ ```bash
80
+ uv tool install "cullet[full]"
81
+ ```
82
+
83
+ ## Usage
84
+
85
+ ```bash
86
+ cullet /path/to/photos
87
+ cullet /path/to/photos/IMG_1234.jpg
88
+ cullet /path/to/photos -a ../good -a ../maybe -T sun -T portrait
89
+ cullet /path/to/photos --dedup
90
+ ```
91
+
92
+ The number keys move the image into the target folders (`-a`) and toggle the tags (`-T`), in the
93
+ order they are given. Deleted files are moved to the system trash, never removed (`--trash_dir`
94
+ puts them into a folder of your choice instead), and every file operation can be undone with
95
+ `u`. `cullet --help` lists all options.
96
+
97
+ ## Command line tools
98
+
99
+ They only log what they would do until `-w` is given. Each has `--help`.
100
+
101
+ | command | does | needs |
102
+ | --- | --- | --- |
103
+ | `cullet-dedup-images` | removes duplicate images, into the system trash or a folder with `-Q` | full extra |
104
+ | `cullet-dedup-videos` | the same for videos | full extra, ffmpeg |
105
+ | `cullet-fix-rotation-images` | finds photos stored sideways or upside down and rotates them | full extra |
106
+ | `cullet-fix-rotation-videos` | the same for videos | full extra, ffmpeg |
107
+ | `cullet-downscale-images` | shrinks images, keeping their metadata | |
108
+ | `cullet-downscale-videos` | shrinks videos | ffmpeg |
109
+
110
+ ```bash
111
+ cullet-dedup-videos /path/to/videos -Q /path/to/quarantine -w
112
+ cullet-downscale-images /path/to/photos -s 1080 -w
113
+ ```
114
+
115
+ ## Install locally and run tests
116
+
117
+ Clone repository and cd into. Setup python 3.10 or higher.
118
+ Note: The tests that need torch are skipped unless it is installed.
119
+
120
+ ```bash
121
+ pip install -e .[full,dev]
122
+ pylint src
123
+
124
+ # run tests
125
+ python -m pytest --cov
126
+ pylint tests
127
+ ```
cullet-0.1.0/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # cullet
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py310.yml">
5
+ <img alt="minimal build 3.10 status" title="minimal build 3.10 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py310.yml?branch=main&label=minimal%20build%203.10" />
6
+ </a>
7
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py314.yml">
8
+ <img alt="minimal build 3.14 status" title="minimal build 3.14 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py314.yml?branch=main&label=minimal%20build%203.14" />
9
+ </a>
10
+ <br />
11
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py310-full.yml">
12
+ <img alt="full build 3.10 status" title="full build 3.10 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py310-full.yml?branch=main&label=full%20build%203.10" />
13
+ </a>
14
+ <a href="https://github.com/simon-ging/cullet/actions/workflows/build-py314-full.yml">
15
+ <img alt="full build 3.14 status" title="full build 3.14 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/cullet/build-py314-full.yml?branch=main&label=full%20build%203.14" />
16
+ </a>
17
+ <br />
18
+ <img alt="coverage" title="coverage" src="https://raw.githubusercontent.com/simon-ging/cullet/main/docs/coverage.svg" />
19
+ <a href="https://pypi.org/project/cullet/">
20
+ <img alt="version" title="version" src="https://img.shields.io/pypi/v/cullet?color=success" />
21
+ </a>
22
+ </p>
23
+
24
+ Keyboard-driven photo viewer for going through a folder fast: step, zoom, rotate, delete, move
25
+ into target folders, tag, and review duplicates. Press `h` in the viewer for the keys.
26
+
27
+ ## Install
28
+
29
+ Requires `python>=3.10`
30
+
31
+ ```bash
32
+ uv tool install cullet
33
+ ```
34
+
35
+ or `pip install cullet` into an environment of your choice. Rotating JPEGs losslessly needs the
36
+ `jpegtran` binary, which comes with `libjpeg-turbo` on most distributions.
37
+
38
+ Finding duplicates and fixing rotations need torch, which comes with the full extra:
39
+
40
+ ```bash
41
+ uv tool install "cullet[full]"
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ ```bash
47
+ cullet /path/to/photos
48
+ cullet /path/to/photos/IMG_1234.jpg
49
+ cullet /path/to/photos -a ../good -a ../maybe -T sun -T portrait
50
+ cullet /path/to/photos --dedup
51
+ ```
52
+
53
+ The number keys move the image into the target folders (`-a`) and toggle the tags (`-T`), in the
54
+ order they are given. Deleted files are moved to the system trash, never removed (`--trash_dir`
55
+ puts them into a folder of your choice instead), and every file operation can be undone with
56
+ `u`. `cullet --help` lists all options.
57
+
58
+ ## Command line tools
59
+
60
+ They only log what they would do until `-w` is given. Each has `--help`.
61
+
62
+ | command | does | needs |
63
+ | --- | --- | --- |
64
+ | `cullet-dedup-images` | removes duplicate images, into the system trash or a folder with `-Q` | full extra |
65
+ | `cullet-dedup-videos` | the same for videos | full extra, ffmpeg |
66
+ | `cullet-fix-rotation-images` | finds photos stored sideways or upside down and rotates them | full extra |
67
+ | `cullet-fix-rotation-videos` | the same for videos | full extra, ffmpeg |
68
+ | `cullet-downscale-images` | shrinks images, keeping their metadata | |
69
+ | `cullet-downscale-videos` | shrinks videos | ffmpeg |
70
+
71
+ ```bash
72
+ cullet-dedup-videos /path/to/videos -Q /path/to/quarantine -w
73
+ cullet-downscale-images /path/to/photos -s 1080 -w
74
+ ```
75
+
76
+ ## Install locally and run tests
77
+
78
+ Clone repository and cd into. Setup python 3.10 or higher.
79
+ Note: The tests that need torch are skipped unless it is installed.
80
+
81
+ ```bash
82
+ pip install -e .[full,dev]
83
+ pylint src
84
+
85
+ # run tests
86
+ python -m pytest --cov
87
+ pylint tests
88
+ ```
@@ -0,0 +1,110 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cullet"
7
+ description = "Keyboard-driven photo viewer for culling, sorting, tagging and deduplicating."
8
+ readme = "README.md"
9
+ authors = [{ "name" = "simon-ging" }]
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ keywords = ["photo", "image", "viewer", "culling", "duplicates"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Environment :: X11 Applications :: Qt",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Operating System :: POSIX :: Linux",
23
+ "Topic :: Multimedia :: Graphics :: Viewers",
24
+ ]
25
+ dynamic = ["version", "dependencies"]
26
+
27
+ [project.optional-dependencies]
28
+ full = ["torch", "torchvision", "tqdm", "numpy"]
29
+ dev = ["pytest", "pytest-cov", "pylint", "numpy"]
30
+
31
+ [project.scripts]
32
+ cullet = "cullet.cli:main"
33
+ cullet-dedup-images = "cullet.cli_dedup_images:main"
34
+ cullet-dedup-videos = "cullet.cli_dedup_videos:main"
35
+ cullet-fix-rotation-images = "cullet.extras:fix_rotation_images"
36
+ cullet-fix-rotation-videos = "cullet.extras:fix_rotation_videos"
37
+ cullet-downscale-images = "cullet.cli_downscale_images:main"
38
+ cullet-downscale-videos = "cullet.cli_downscale_videos:main"
39
+
40
+ [project.urls]
41
+ Project-URL = "https://github.com/simon-ging/cullet"
42
+
43
+ [tool.setuptools]
44
+ zip-safe = true
45
+ platforms = ["any"]
46
+ include-package-data = false
47
+
48
+ [tool.setuptools.dynamic]
49
+ version = { attr = "cullet.__version__" }
50
+ dependencies = {file = ["requirements.txt"]}
51
+
52
+ [tool.pytest.ini_options]
53
+ testpaths = ["tests"]
54
+
55
+ [tool.black]
56
+ line-length = 100
57
+
58
+ [tool.coverage.run]
59
+ source_pkgs = ["cullet"]
60
+ branch = true
61
+
62
+ [tool.coverage.report]
63
+ skip_empty = true
64
+
65
+ [tool.coverage.html]
66
+ directory = ".covreport"
67
+
68
+ [tool.coverage.xml]
69
+ output = ".covreport/coverage.xml"
70
+
71
+ [tool.pylint.main]
72
+ jobs = 1
73
+ extension-pkg-allow-list = ["PySide6"]
74
+
75
+ [tool.pylint.messages_control]
76
+
77
+ enable = "all"
78
+
79
+ disable = [
80
+ 'suppressed-message', 'locally-disabled', 'line-too-long', 'missing-module-docstring',
81
+ 'missing-class-docstring', 'missing-function-docstring', 'fixme',
82
+ 'f-string-without-interpolation', 'invalid-name',
83
+ 'logging-fstring-interpolation', 'consider-iterating-dictionary',
84
+ 'use-implicit-booleaness-not-comparison',
85
+ 'attribute-defined-outside-init', 'consider-using-with', 'global-statement',
86
+ 'import-outside-toplevel', 'super-init-not-called', 'broad-exception-caught',
87
+ 'disallowed-name', 'redefined-outer-name', 'use-implicit-booleaness-not-comparison-to-zero',
88
+ 'eval-used', 'unknown-option-value', 'arguments-differ', 'subprocess-run-check',
89
+ 'use-implicit-booleaness-not-comparison-to-string', 'use-dict-literal',
90
+ 'useless-suppression', 'too-many-positional-arguments', 'use-symbolic-message-instead',
91
+ ]
92
+
93
+ [tool.pylint.format]
94
+ max-line-length = 99999
95
+ max-module-lines = 99999
96
+
97
+ [tool.pylint.refactoring]
98
+ max-nested-blocks = 9999
99
+
100
+ [tool.pylint.design]
101
+ max-args = 9999
102
+ max-attributes = 9999
103
+ max-bool-expr = 9999
104
+ max-branches = 9999
105
+ max-locals = 9999
106
+ max-parents = 9999
107
+ max-public-methods = 9999
108
+ max-returns = 9999
109
+ max-statements = 9999
110
+ min-public-methods = 0
@@ -0,0 +1,6 @@
1
+ PySide6
2
+ Pillow
3
+ natsort
4
+ typedparser
5
+ pathspec>=1.0
6
+ filetype
cullet-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ from cullet.cli import main
2
+
3
+ main()