Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
pull_request:

jobs:
checks:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: "pip"

- name: Install package and dev tools
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest ruff mypy

- name: Lint
run: ruff check .

- name: Format check
run: ruff format --check .

- name: Type check
run: mypy src

- name: Test
run: pytest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.venv/
.venv-test
__pycache__/
*.pyc
.DS_Store
*.egg-info/
data
data
dist/
build/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ typecheck:
test:
pytest

check: lint test typecheck
check: lint test format typecheck
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[![CI](https://github.com/aga87/python-photo-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/aga87/python-photo-tools/actions)

# Python Photo Tools

A command-line tool for organising and processing photos using Python.

## Branches
## Supported formats

- `main` – Stable branch. Contains production-ready code and reflects the latest completed features.
- `dev` – Integration branch. Used to combine and test feature branches before merging into `main`.
- RAW: .raf
- JPG: .jpg, .jpeg

## Prerequisites - System Tools

Expand Down Expand Up @@ -34,6 +36,22 @@ If running in a Docker container, include:
RUN apt-get update && apt-get install -y exiftool
```

## Installation

### Using pipx (recommended)

```shell
pipx install git+https://github.com/aga87/python-photo-tools.git
```

### Local development

Clone the repository and install:

```shell
pip install .
```

## Usage

List available commands:
Expand Down Expand Up @@ -114,7 +132,7 @@ photo-tools optimise <INPUT_DIR>
photo-tools optimise <INPUT_DIR> --dry-run
```

## Local Testing Setup
## Local Development Setup

### Data

Expand Down Expand Up @@ -157,4 +175,4 @@ Other commands follow the same structure but are not yet covered.

### Makefile

Common development tasks are available via the Makefile.
Common development tasks are available via the Makefile.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requires-python = ">=3.13"
dependencies = ["typer>=0.24,<1.0", "pillow>=12.1,<13.0"]

[dependency-groups]
dev = ["pytest>=9,<10", "ruff>=0.15,<1.0", "mypy>=1.19,<2.0"]
dev = ["pytest>=9,<10", "ruff>=0.15,<1.0", "mypy>=1.19,<2.0", "build>=1.4,<2.0"]

[project.scripts]
photo-tools = "photo_tools.cli:app"
Expand Down
6 changes: 2 additions & 4 deletions src/photo_tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from photo_tools.organise_by_type import organise_by_type
from photo_tools.soft_delete_unpaired_raws import soft_delete_unpaired_raws

app = typer.Typer(
help="CLI tools for organising and optimising photography workflows."
)
app = typer.Typer(help="CLI tools for organising and optimising photography workflows.")


@app.callback()
Expand Down Expand Up @@ -91,7 +89,7 @@ def soft_delete_unpaired_raws_cmd(

@app.command(
"optimise",
help="Resize JPG images to max 2500px width and compress to ≤500KB using quality " \
help="Resize JPG images to max 2500px width and compress to ≤500KB using quality "
"70-100, saving as prefixed copies.",
)
def optimise_cmd(
Expand Down
Loading