Skip to main content

Rename image files based on their visual contents using AI vision models.

Project description

Image Namer

Rename image files based on their visual contents using AI vision models.

License: MIT Python 3.13+

Transform generic filenames like IMG_2347.jpg into descriptive names like golden-retriever-puppy--running-in-park.jpg using AI vision analysis.

Features

  • 🤖 AI-powered naming using Ollama (local) or OpenAI (cloud)
  • 🏠 Local-first with Ollama for privacy
  • Intelligent caching to avoid redundant API calls
  • 🔄 Idempotent - won't rename already-suitable files
  • 📁 Batch processing with recursive folder support
  • 📝 Markdown reference updates for Obsidian and standard markdown
  • 🔍 Dry-run mode to preview changes safely
  • 🎯 Smart collision handling

Quick Start

Installation (Recommended: pipx)

Install Image Namer using pipx for a clean, isolated installation:

# Install pipx (if needed)
brew install pipx  # macOS
# or: python3 -m pip install --user pipx

# Install image-namer
pipx install git+https://github.com/svetzal/image-namer.git

# Verify installation
image-namer --help

Why pipx? It installs Python CLI tools in isolated environments, preventing dependency conflicts with other projects.

Setup AI Provider

Image Namer requires an AI vision model. Choose one:

Option 1: Ollama (Recommended - Free & Local)

# Install from https://ollama.com
ollama pull gemma3:27b

Option 2: OpenAI (Cloud - Requires API Key)

export OPENAI_API_KEY='sk-proj-...'

Basic Usage

# Preview rename (dry-run)
image-namer file photo.jpg

# Apply rename
image-namer file photo.jpg --apply

# Process entire folder
image-namer folder ~/Pictures/screenshots --apply

# Update markdown references
image-namer folder ~/Documents/notes/images --apply --update-refs

Documentation

📚 Full Documentation (comprehensive guides and reference)

Quick links:

Development

Setup

# Clone repository
git clone https://github.com/svetzal/image-namer.git
cd image-namer

# Install with development dependencies (using uv)
uv venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

# Or with pip
pip install -e ".[dev]"

Testing

pytest                    # Run all tests with coverage
pytest -v --no-cov       # Verbose without coverage
flake8 src               # Lint code

Documentation

# Install docs dependencies (included in [dev])
pip install -e ".[dev]"

# Serve docs locally
mkdocs serve

# Build docs locally
mkdocs build

Note: Documentation is automatically deployed to GitHub Pages when a new release is published. See docs/GITHUB_PAGES_SETUP.md for details.

Requirements

  • Python 3.13 or later
  • AI provider: Ollama (local) or OpenAI (cloud)

License

MIT License - see LICENSE

Project Status

🎉 Version 1.0.0 - Production Ready

Complete Features

Core Functionality

  • Single file and batch folder renaming with AI vision analysis
  • Smart pre-flight assessment to skip already-suitable files
  • Intelligent caching system (dramatically reduces LLM calls)
  • Idempotent operations (won't rename if name already matches content)

Markdown Integration

  • Automatic reference updates in standard Markdown and Obsidian
  • Preserves alt text and aliases
  • URL-encoded path handling

AI Providers

  • Ollama (local, privacy-focused, default)
  • OpenAI (cloud-based)
  • Easy provider switching via CLI or environment variables

Developer-Friendly

  • 94 comprehensive tests with 88% coverage
  • Type-safe with Pydantic models
  • Well-documented code and APIs
  • Flake8 compliant

What's Not Included (By Design)

  • GUI interface (CLI-first approach)
  • Video or PDF processing (images only)
  • Multi-language filename support (English slugs)

See CHANGELOG.md for detailed release notes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

image_namer-1.0.1.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

image_namer-1.0.1-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file image_namer-1.0.1.tar.gz.

File metadata

  • Download URL: image_namer-1.0.1.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for image_namer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 609604dca9464f141f84b83f570c84e384bdde2c54eeb384b265e8bd8d499353
MD5 4646553d062ce6d8cd6ad73e49032d08
BLAKE2b-256 a5f0f95a6d7cf62e9d5195ee40177f1da8958c5399819196088a8b73dbd9a87b

See more details on using hashes here.

Provenance

The following attestation bundles were made for image_namer-1.0.1.tar.gz:

Publisher: ci.yml on svetzal/image-namer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file image_namer-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: image_namer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for image_namer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d0a78e5c94dad252e5faa010ac878dc244e87f4dcb5511ec8f793190decce82
MD5 6c5df396d4c6982557d5f321461819cf
BLAKE2b-256 54ffeea175249419cc2067cee60ea68300c3f4073cd55e2eddbe811ea3ff374f

See more details on using hashes here.

Provenance

The following attestation bundles were made for image_namer-1.0.1-py3-none-any.whl:

Publisher: ci.yml on svetzal/image-namer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page