smart-media-manager 0.5.43a4__py3-none-any.whl

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.
@@ -0,0 +1,340 @@
1
+ Metadata-Version: 2.4
2
+ Name: smart-media-manager
3
+ Version: 0.5.43a4
4
+ Summary: A macOS CLI that audits media folders, fixes extensions, and imports into Apple Photos
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: filetype>=1.2.0
9
+ Requires-Dist: puremagic>=1.30
10
+ Requires-Dist: isbinary>=1.0.1
11
+ Requires-Dist: python-magic>=0.4.27
12
+ Requires-Dist: pyfsig>=1.1.1
13
+ Requires-Dist: pillow>=12.0.0
14
+ Requires-Dist: rawpy>=0.25.1
15
+ Provides-Extra: enhanced
16
+ Dynamic: license-file
17
+
18
+ # Smart Media Manager (ALPHA)
19
+
20
+ > [!WARNING]
21
+ > **⚠ Alpha Software - Do Not Use in Production**
22
+ >
23
+ > This project is currently in **alpha stage** and under active development. It may contain bugs, incomplete features, or unexpected behavior. **Do not use this tool on your only copy of important media files.** Always maintain backups before running this software.
24
+
25
+ Status: **Alpha (pre-release)** — breaking changes and data loss risks are possible.
26
+
27
+ <p align="center">
28
+ <strong>A macOS-first CLI that audits folders of photos and videos, fixes mismatched extensions, stages compatible media, and imports everything into Apple Photos without manual clicking.</strong>
29
+ </p>
30
+
31
+ <p align="center">
32
+ <a href="#-highlights">Highlights</a> •
33
+ <a href="#-requirements">Requirements</a> •
34
+ <a href="#-installation">Installation</a> •
35
+ <a href="#-usage">Usage</a> •
36
+ <a href="#-development">Development</a> •
37
+ <a href="#-testing">Testing</a>
38
+ </p>
39
+
40
+ ---
41
+
42
+ Smart Media Manager normalizes filenames, validates files via multiple signature detectors, auto-installs transcode dependencies, and keeps a skip log so nothing silently disappears.
43
+
44
+ ## ✦ Highlights
45
+
46
+ - **Deterministic detection pipeline** — Powered by libmagic, PureMagic, PyFSig, binwalk, and ffprobe consensus voting plus RAW refinement
47
+ - **Fail-fast conversions** — Direct source→target conversion with automatic cleanup on failure (v0.4.0: backup system removed for simplicity)
48
+ - **Extension preservation** — File extensions are never changed unless the detected format differs (v0.4.0: fixes .mp4 → .mov renaming bug)
49
+ - **Dependency bootstrapper** — Installs Homebrew formulas (`ffmpeg`, `libheif`, `imagemagick`, etc.) and RAW codecs only when the current camera family needs them
50
+ - **Apple Photos automation** — Batched AppleScript commands with rate-limiting and retry logic, metadata preservation using `exiftool`
51
+ - **Comprehensive statistics** — Color-coded summary with detailed metrics for scanned, converted, imported, and skipped files
52
+ - **Interactive retry** — Prompt to retry failed imports without re-running the entire pipeline
53
+ - **Transparent skip logging** — Corrupt files, archives, vector artwork, and unsupported assets are called out with remediation guidance
54
+ - **Progress tracking** — Real-time progress bars with ETA for each pipeline stage
55
+ - **Corrupt video detection** — Validates video files before staging to avoid wasted time
56
+ - **Smart conversions** — PNG preferred for images (faster, smaller), remuxing for compatible codecs
57
+
58
+ ## ▣ Requirements
59
+
60
+ | Requirement | Details |
61
+ |-------------|---------|
62
+ | **Operating System** | macOS 12 (Monterey) or newer with stock Photos app<br>⚠ Does **not** work on Windows or Linux |
63
+ | **Package Manager** | Homebrew (auto-installs dependencies) |
64
+ | **Python** | 3.12+ (managed by `uv`) |
65
+ | **Disk Space** | Sufficient for staging folders and logs |
66
+
67
+ ### ⚙ Configuration Notes
68
+
69
+ <details>
70
+ <summary><b>Skipping dependency bootstrap</b></summary>
71
+
72
+ If you prefer to manage Homebrew/pip packages yourself, pass `--skip-bootstrap` (or set `SMART_MEDIA_MANAGER_SKIP_BOOTSTRAP=1`). The CLI will trust your environment and skip auto-installs, but will fail if required tools are missing.
73
+ </details>
74
+
75
+ <details>
76
+ <summary><b>No automatic fallbacks</b></summary>
77
+
78
+ When Apple Photos refuses a file, the CLI logs it to `smm_skipped_files_<timestamp>.log` and moves on. It never attempts emergency conversions that could explode disk usage.
79
+ </details>
80
+
81
+ ## ⬇ Installation
82
+
83
+ ### Recommended: Install as a tool
84
+
85
+ Install globally with `uv tool` (creates `smart-media-manager` executable on your PATH):
86
+
87
+ ```bash
88
+ uv tool install smart-media-manager
89
+ ```
90
+
91
+ This is the recommended method. The executable will be available system-wide as `smart-media-manager`.
92
+
93
+ To install a specific version:
94
+
95
+ ```bash
96
+ uv tool install smart-media-manager==0.5.43a3
97
+ ```
98
+
99
+ ### Alternative: Install as a package
100
+
101
+ Install into a project or virtual environment:
102
+
103
+ ```bash
104
+ # Add to project dependencies
105
+ uv add smart-media-manager
106
+
107
+ # Or install in current venv
108
+ uv pip install smart-media-manager
109
+ ```
110
+
111
+ When installed as a package, run with: `uv run smart-media-manager` or activate the venv first.
112
+
113
+ ---
114
+
115
+ ## ▶ Usage
116
+
117
+ ### Quick start
118
+
119
+ Import all media from the current directory:
120
+
121
+ ```bash
122
+ smart-media-manager
123
+ ```
124
+
125
+ ### Common examples
126
+
127
+ Scan a specific folder recursively:
128
+
129
+ ```bash
130
+ smart-media-manager ~/Pictures/Inbox --recursive
131
+ ```
132
+
133
+ Scan and delete staging folder after successful import:
134
+
135
+ ```bash
136
+ smart-media-manager ~/Downloads/Photos --recursive --delete
137
+ ```
138
+
139
+ Import a single file:
140
+
141
+ ```bash
142
+ smart-media-manager ~/Downloads/photo.jpg
143
+ ```
144
+
145
+ Import into a specific album (non-interactive):
146
+
147
+ ```bash
148
+ smart-media-manager ~/Pictures/Vacation --recursive --album "Summer 2024" -y
149
+ ```
150
+
151
+ ### Command-line options
152
+
153
+ | Option | Description |
154
+ |--------|-------------|
155
+ | `PATH` | Directory to scan (default: current directory) or path to a single file |
156
+ | `--recursive` | Recursively scan subdirectories |
157
+ | `--follow-symlinks` | Follow symbolic links when scanning |
158
+ | `--delete` | Delete staging folder after successful import |
159
+ | `--album NAME` | Photos album name to import into (default: 'Smart Media Manager') |
160
+ | `--copy` | Copy files to staging instead of moving (originals untouched) |
161
+ | `--skip-duplicate-check` | Skip duplicate checking during import (faster but may import duplicates) |
162
+ | `--skip-bootstrap` | Skip automatic dependency installation |
163
+ | `--skip-convert` | Skip format conversion/transcoding (files must already be compatible) |
164
+ | `--skip-compatibility-check` | Skip all compatibility validation (may cause import errors) |
165
+ | `--max-image-pixels VALUE` | Set Pillow image pixel limit; use `none` to disable (default) |
166
+ | `-y, --yes, --assume-yes` | Skip confirmation prompt (useful for automation) |
167
+ | `--version` | Show version and exit |
168
+
169
+ ### What happens during a run
170
+
171
+ 1. **Scanning** — Discovers all files with real-time progress
172
+ 2. **Detection** — Identifies media types using consensus voting
173
+ 3. **Staging** — Moves files to `FOUND_MEDIA_FILES_<timestamp>` folder
174
+ 4. **Conversion** — Processes incompatible formats (PNG, HEVC, etc.)
175
+ 5. **Import** — Sends batches to Apple Photos via AppleScript
176
+ 6. **Statistics** — Displays color-coded summary with success rates
177
+ 7. **Retry prompt** — Option to retry failed imports (if any)
178
+
179
+ ### Output and logging
180
+
181
+ | Output | Location | Description |
182
+ |--------|----------|-------------|
183
+ | **Console** | Terminal | Progress bars, warnings, statistics summary |
184
+ | **Run log** | `.smm_logs/smm_run_<timestamp>.log` | Detailed INFO-level logs |
185
+ | **Skip log** | `smm_skipped_files_<timestamp>.log` | Failed/skipped files with reasons |
186
+ | **Staging** | `FOUND_MEDIA_FILES_<timestamp>/` | Processed media (kept unless `--delete`) |
187
+
188
+ ### Interactive features
189
+
190
+ After import completes, if any files failed:
191
+ - ✦ **Statistics summary** — Detailed breakdown with color coding
192
+ - ✦ **Retry prompt** — Option to retry just the failed imports
193
+ - ✦ **Updated results** — Final statistics after retry
194
+
195
+ During Photos import, if a dialog blocks:
196
+ - ✦ **Dialog detection** — Detects when Photos is waiting for user interaction
197
+ - ✦ **Retry prompt** — Close the dialog and press Enter to continue, or type 'abort' to cancel
198
+
199
+ ### Graceful interruption
200
+
201
+ Press **Ctrl+C** at any time to cleanly interrupt the process:
202
+ - Logs are saved to the run log file
203
+ - Skip log is preserved if it has entries
204
+ - Staging folder is preserved for manual recovery
205
+ - Exit code 130 (standard SIGINT) is returned
206
+
207
+ ---
208
+
209
+ ## ⚙ Development
210
+
211
+ ### Quick setup
212
+
213
+ ```bash
214
+ # Clone and enter
215
+ git clone https://github.com/Emasoft/Smart-Media-Manager.git
216
+ cd Smart-Media-Manager
217
+
218
+ # Install dependencies (runtime + dev tools) and enable hooks
219
+ uv sync
220
+ git config core.hooksPath githooks
221
+
222
+ # Install editable version (optional)
223
+ uv tool install --editable .
224
+
225
+ # Run tests
226
+ uv run pytest
227
+ ```
228
+
229
+ ### Development workflow
230
+
231
+ 1. **Make changes** to the codebase
232
+ 2. **Run tests** with `uv run pytest`
233
+ 3. **Format code** with `uv run ruff format --line-length=320 smart_media_manager/ tests/`
234
+ 4. **Check linting** with `uv run ruff check smart_media_manager/ tests/`
235
+
236
+ ### Version management
237
+
238
+ Bump version (dev only):
239
+
240
+ ```bash
241
+ # Bump to next alpha version
242
+ uv version --bump minor --bump alpha
243
+
244
+ # Verify version
245
+ smart-media-manager --version
246
+ ```
247
+
248
+ ---
249
+
250
+ ## ⊕ Testing
251
+
252
+ Run the test suite:
253
+
254
+ ```bash
255
+ uv run pytest
256
+ ```
257
+
258
+ Tests use lightweight sample media and monkeypatched detectors, so most scenarios run without Apple Photos.
259
+
260
+ ---
261
+
262
+ ## ▣ Privacy & Data Hygiene
263
+
264
+ > [!CAUTION]
265
+ > **Sensitive Data Warning**
266
+
267
+ - **Skip logs** (`smm_skipped_files_<timestamp>.log`) may contain partial paths — redact before sharing
268
+ - **Staging directories** (`FOUND_MEDIA_FILES_*`) are large and gitignored — delete after confirming imports
269
+ - **Always scan for secrets** before opening PRs or releases
270
+
271
+ ---
272
+
273
+ ## ▤ Release Checklist
274
+
275
+ 1. Update CHANGELOG.md
276
+ 2. Bump version: `uv version --bump minor --bump alpha`
277
+ 3. Run tests: `uv run pytest`
278
+ 4. Scan for secrets: `uv tool run gitleaks detect --no-banner`
279
+ 5. Build: `uv build`
280
+ 6. Inspect `dist/` contents
281
+ 7. Tag and push: `git tag vX.Y.ZaN` then `git push origin vX.Y.ZaN`
282
+ 8. Publish: `uv publish` (PyPI)
283
+ 9. GitHub release: created automatically on tag push via workflow
284
+
285
+ ---
286
+
287
+ ## ▦ License
288
+
289
+ MIT License - see [LICENSE](LICENSE) file for details.
290
+
291
+ ## ▧ Contributing
292
+
293
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
294
+
295
+ ## ▨ Changelog
296
+
297
+ See [CHANGELOG.md](CHANGELOG.md) for version history.
298
+
299
+ ---
300
+
301
+ ## ▩ Local Documentation
302
+
303
+ The `docs_dev/` folder is gitignored and protected by hooks. It's automatically backed up to `.git/local_backups/docs_dev.tar.gz` during git operations.
304
+
305
+ Enable hooks once per clone:
306
+
307
+ ```bash
308
+ git config core.hooksPath githooks
309
+ ```
310
+
311
+ Manual backup/restore:
312
+
313
+ ```bash
314
+ ./scripts/protect_docs_dev.sh backup # Create backup
315
+ ./scripts/protect_docs_dev.sh restore # Restore from backup
316
+ ```
317
+
318
+ ---
319
+
320
+ ## ▤ Licensing & Dependencies
321
+
322
+ Smart Media Manager is MIT licensed. Runtime dependencies:
323
+
324
+ | Component | License | Notes |
325
+ |-----------|---------|-------|
326
+ | `filetype` 1.2.0 | MIT | https://pypi.org/project/filetype/ |
327
+ | `puremagic` 1.30 | MIT | Keep copyright notice |
328
+ | `isbinary` 1.0.1 | BSD-3-Clause | Include attribution if redistributed |
329
+ | `python-magic` 0.4.27 | MIT | Wraps system `libmagic` |
330
+ | `pyfsig` 1.1.1 | MIT | Signature detection |
331
+ | `pillow` 12.0.0 | HPND/MIT-CMU | Retain license when redistributing |
332
+ | `rawpy` 0.25.1 | MIT | RAW image processing via LibRaw |
333
+
334
+ External tools via Homebrew (binwalk, ffmpeg, imagemagick, exiftool, etc.) ship under their own licenses.
335
+
336
+ ---
337
+
338
+ ## ▦ Support
339
+
340
+ Open an issue or discussion in the repository for bugs, feature requests, or compatibility updates.
@@ -0,0 +1,15 @@
1
+ smart_media_manager/__init__.py,sha256=snLxulE0TltKqllLzCePtjVcsSdmb1x6i1ZDg1ygo54,298
2
+ smart_media_manager/cli.py,sha256=k5dE7ENgSEieRwOh9CkVzPN1PU18JHZkHevm_ioHLS8,185248
3
+ smart_media_manager/format_compatibility.json,sha256=oH2ATe4ZiI7Kh1tzHER8dkv3w6KMlb9lJMIrO2Md7tg,22771
4
+ smart_media_manager/format_registry.json,sha256=lA2pTkin-6VmSImguVyXcuZxrbazRkCTypIce_C8eTk,292285
5
+ smart_media_manager/format_registry.py,sha256=0jptKxvhamV9m9FfOd1Qd3tGRKcVIv97XhRYMXZSOto,18581
6
+ smart_media_manager/format_rules.py,sha256=00hQ-o6diDdbHjo75l06Qo8UufL89MGnR-GT3Tljt8o,21109
7
+ smart_media_manager/metadata_registry.json,sha256=Oml-53jkp3VuKTR2hvESMf_p8TacpR4rfi7blMb4eiM,29497
8
+ smart_media_manager/metadata_registry.py,sha256=WZQwBqhaU8xzifcHPC-w7r6085kyPxKB6jikgJFNGJE,8091
9
+ smart_media_manager/uuid_generator.py,sha256=XeGOMsqOw3Ei4rM8SC5L-Sn8XBlmWDg6xz5sl3qEl_E,4756
10
+ smart_media_manager-0.5.43a4.dist-info/licenses/LICENSE,sha256=hBwrLvNIqQIpItBO_19uelTKWtkUCaGQoJH6t1aBrjo,1089
11
+ smart_media_manager-0.5.43a4.dist-info/METADATA,sha256=EuHsHNpA37PIHXcbCh5_P13u7KPgdSfFNVNvHHX2ygU,11321
12
+ smart_media_manager-0.5.43a4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ smart_media_manager-0.5.43a4.dist-info/entry_points.txt,sha256=X36nRMyVCXaKrPQzrMOOfAlznF4VgopizD4PNrESAaU,68
14
+ smart_media_manager-0.5.43a4.dist-info/top_level.txt,sha256=iqxsYq_fe5-wo3HkCuFDyFfPrQ6-AEILsVkflAn7wZI,20
15
+ smart_media_manager-0.5.43a4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ smart-media-manager = smart_media_manager.cli:run
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Smart Media Manager Contributors
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 @@
1
+ smart_media_manager