tripsort 0.0.1__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.
- tripsort/__init__.py +7 -0
- tripsort/__main__.py +5 -0
- tripsort/cli.py +58 -0
- tripsort/py.typed +0 -0
- tripsort-0.0.1.dist-info/METADATA +111 -0
- tripsort-0.0.1.dist-info/RECORD +9 -0
- tripsort-0.0.1.dist-info/WHEEL +4 -0
- tripsort-0.0.1.dist-info/entry_points.txt +3 -0
- tripsort-0.0.1.dist-info/licenses/LICENSE +21 -0
tripsort/__init__.py
ADDED
tripsort/__main__.py
ADDED
tripsort/cli.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Command-line interface: a thin Typer layer over the tripsort API."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Annotated
|
|
5
|
+
|
|
6
|
+
import typer
|
|
7
|
+
|
|
8
|
+
from tripsort import __version__
|
|
9
|
+
|
|
10
|
+
app = typer.Typer(
|
|
11
|
+
name="tripsort",
|
|
12
|
+
help="Turn a group trip's photo zips into deduplicated, sorted folders, fully offline.",
|
|
13
|
+
no_args_is_help=True,
|
|
14
|
+
add_completion=False,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _version_callback(value: bool) -> None:
|
|
19
|
+
if value:
|
|
20
|
+
typer.echo(f"tripsort {__version__}")
|
|
21
|
+
raise typer.Exit()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@app.callback()
|
|
25
|
+
def main(
|
|
26
|
+
version: Annotated[
|
|
27
|
+
bool,
|
|
28
|
+
typer.Option(
|
|
29
|
+
"--version",
|
|
30
|
+
callback=_version_callback,
|
|
31
|
+
is_eager=True,
|
|
32
|
+
help="Show the version and exit.",
|
|
33
|
+
),
|
|
34
|
+
] = False,
|
|
35
|
+
) -> None:
|
|
36
|
+
"""Turn a group trip's photo zips into deduplicated, sorted folders, fully offline."""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@app.command()
|
|
40
|
+
def run(
|
|
41
|
+
zips: Annotated[
|
|
42
|
+
list[Path],
|
|
43
|
+
typer.Argument(
|
|
44
|
+
metavar="ZIP", help="Zip files of photos and videos, usually one per person."
|
|
45
|
+
),
|
|
46
|
+
],
|
|
47
|
+
out: Annotated[
|
|
48
|
+
Path,
|
|
49
|
+
typer.Option("--out", "-o", help="Output folder for the sorted files and the index."),
|
|
50
|
+
],
|
|
51
|
+
refs: Annotated[
|
|
52
|
+
Path | None,
|
|
53
|
+
typer.Option(help="Folder with one clear photo per person, used to name people."),
|
|
54
|
+
] = None,
|
|
55
|
+
) -> None:
|
|
56
|
+
"""Ingest, analyze, and export in one step."""
|
|
57
|
+
typer.echo("tripsort run is not implemented yet; it arrives in a later release.", err=True)
|
|
58
|
+
raise typer.Exit(code=1)
|
tripsort/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tripsort
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Offline Python library + CLI that merges trip photo zips, removes duplicates, and sorts photos by person, shot type, and category.
|
|
5
|
+
Keywords: photos,deduplication,face-clustering,clip,offline,cli
|
|
6
|
+
Author: Shubh Dave
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Dist: typer>=0.29.1
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Project-URL: Homepage, https://github.com/logn1602/tripsort
|
|
24
|
+
Project-URL: Repository, https://github.com/logn1602/tripsort
|
|
25
|
+
Project-URL: Issues, https://github.com/logn1602/tripsort/issues
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# tripsort
|
|
29
|
+
|
|
30
|
+
Offline Python library + CLI that merges trip photo zips, removes duplicates, and sorts photos by person, shot type, and category.
|
|
31
|
+
|
|
32
|
+
> **Status: pre-alpha.** 0.0.1 is a placeholder release: the package installs and
|
|
33
|
+
> `tripsort --version` works, but nothing else does yet. The first useful pre-release
|
|
34
|
+
> will be 0.1.0a1 (ingest, index, and dedupe).
|
|
35
|
+
|
|
36
|
+
## What it will do
|
|
37
|
+
|
|
38
|
+
After a group trip, everyone has a zip of photos from their own phone. tripsort takes all of them and:
|
|
39
|
+
|
|
40
|
+
- merges them into one pool and removes exact duplicates and recompressed copies (such as WhatsApp copies), keeping the best original;
|
|
41
|
+
- groups faces by person across every zip, so each friend gets a folder with every photo they appear in;
|
|
42
|
+
- splits shots into solo, group, and selfie, ignoring strangers in the background;
|
|
43
|
+
- sorts photos into categories such as scenery, animals, food, and documents, defined as editable text prompts;
|
|
44
|
+
- culls bursts down to the best shot and flags blurry, dark, or eyes-closed photos without deleting anything;
|
|
45
|
+
- exports plain folders plus a `manifest.json`, and never modifies the input zips.
|
|
46
|
+
|
|
47
|
+
Everything runs locally on an ordinary laptop CPU: no account, no cloud uploads, no telemetry.
|
|
48
|
+
|
|
49
|
+
## Planned usage
|
|
50
|
+
|
|
51
|
+
Not implemented yet; this is the target interface:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
uvx tripsort run mine.zip sam.zip alex.zip -o sorted/ --refs refs/
|
|
55
|
+
|
|
56
|
+
sorted/
|
|
57
|
+
├── all/ every kept file, once
|
|
58
|
+
├── people/ one folder per person
|
|
59
|
+
├── shots/ solo/, group/, selfie/
|
|
60
|
+
├── categories/ scenery/, animals/, food/, documents/
|
|
61
|
+
├── rejects/ blurry, dark, eyes closed: review before deleting
|
|
62
|
+
└── manifest.json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from tripsort import Project
|
|
67
|
+
|
|
68
|
+
proj = Project.open("sorted/")
|
|
69
|
+
proj.ingest(["mine.zip", "sam.zip", "alex.zip"])
|
|
70
|
+
proj.analyze()
|
|
71
|
+
result = proj.export()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
Requires Python 3.11 or newer.
|
|
77
|
+
|
|
78
|
+
```console
|
|
79
|
+
uvx tripsort --version
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
or `pip install tripsort`.
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
The project uses [uv](https://docs.astral.sh/uv/) for everything. Settled design decisions are
|
|
87
|
+
logged in [docs/decisions.md](docs/decisions.md).
|
|
88
|
+
|
|
89
|
+
```console
|
|
90
|
+
uv sync # create .venv with the dev tools
|
|
91
|
+
uv run pytest --cov # tests with coverage
|
|
92
|
+
uv run ruff check . # lint
|
|
93
|
+
uv run ruff format --check . # formatting
|
|
94
|
+
uv run mypy # strict type check of src/
|
|
95
|
+
uv run pre-commit install # optional: run the checks on every commit
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
CI runs the tests, linters, and type checks on Windows, macOS, and Linux with Python 3.11 to 3.13.
|
|
99
|
+
|
|
100
|
+
### Releasing
|
|
101
|
+
|
|
102
|
+
1. Set the new version in `pyproject.toml` (`uv version <new-version>`), merge to `main`.
|
|
103
|
+
2. Tag the merge commit on `main` with `v<version>` and push the tag.
|
|
104
|
+
3. `.github/workflows/release.yml` builds the package, publishes it to TestPyPI, installs it from
|
|
105
|
+
there on every OS (only tripsort from TestPyPI, its dependencies from PyPI), then publishes to
|
|
106
|
+
PyPI. Both uploads use Trusted Publishing, so the repo stores no tokens.
|
|
107
|
+
4. To repeat the TestPyPI install check locally: `uv run tools/verify_testpypi.py`.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
tripsort/__init__.py,sha256=-yzgo31mm266RkNPsy0ZrN3YTpKIXXkk2qfqk9X2TMs,199
|
|
2
|
+
tripsort/__main__.py,sha256=o3vlctc80kZlfXQcOQfllfFT1_WdwA-_GJAn-8qPeu4,91
|
|
3
|
+
tripsort/cli.py,sha256=YUsxaorLadWraZ_bPI5KOD1hAHAHondp7aqBVN0XpYs,1520
|
|
4
|
+
tripsort/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
tripsort-0.0.1.dist-info/licenses/LICENSE,sha256=q3ajcQYolaTxhbz1xUl4rvdFmPPisSsEu6FjCHh_1WM,1067
|
|
6
|
+
tripsort-0.0.1.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
|
|
7
|
+
tripsort-0.0.1.dist-info/entry_points.txt,sha256=iZeJd741VGmozarK4fhzGJo6MMgGgd7yJx-ss-ua31M,47
|
|
8
|
+
tripsort-0.0.1.dist-info/METADATA,sha256=Q5XNUBPyKIYPcxgqbGYjHCyJcTQD9LKIcAm49yrXb-I,4327
|
|
9
|
+
tripsort-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shubh Dave
|
|
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.
|