2017 © Pedro Peláez
 

library shotwell

A PHP library providing a simple API to a Shotwell (the default Ubuntu image manager) sqlite database.

image

narcoticfresh/shotwell

A PHP library providing a simple API to a Shotwell (the default Ubuntu image manager) sqlite database.

  • Sunday, June 12, 2016
  • by narcoticfresh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

shotwell - a PHP library for Shotwell databases

PHP version Build Status Scrutinizer Code Quality Code Coverage, (*1)

This is a simple PHP library for dealing with Shotwell (the default photo manager in Ubuntu) sqlite databases., (*2)

Basic stuff

Why does it exist?

I'm using Shotwell for my pictures and videos (having a huge collection) and I think it's superb!, (*3)

I found myself in need to use the data stored in the Shotwell database (that btw usually resides in ~/.local/share/shotwell/data/photo.db) to script some stuff (like tagging video files with the tags I've given in Shotwell - a thing that it doesn't seem to be able to do)., (*4)

Being initially pleased that all the data I accumulated is an an re-usable format (a SQLite database), I quickly became puzzled with the structure of that said database. The storage of the different media types (video/photo) and the relations are rather unusual., (*5)

To make matters simpler, this small library was created., (*6)

No. It's a simple thing that hides some Shotwell internal complexity and then gives back plain arrays of the database content., (*7)

I didn't need more - I thought about creating custom Models to represent the data structures, but it doesn't make any sense. Also, only the functions I needed (mostly in regard to basic manipulations and tagging) are implemented., (*8)

Why is it here?

It's only here because I needed the library on more than one of my private projects. To make that dependency stuff easier, it had to go on Packagist so it had to go somewhere. So that somewhere is here., (*9)

Installation

Just use composer, see the Packagist page., (*10)

Require it like this:, (*11)

composer require narcoticfresh/shotwell

Usage example

<?php

// make sure composer autoloader is there
require_once 'vendor/autoload.php';

$shotwell = new \Narcoticfresh\Shotwell\Api('/home/user/.local/share/shotwell/data/photo.db');

// get everything
$items = $shotwell->getAll();

// get only photos
$items = $shotwell->getAllPhotos();

// get only videos
$items = $shotwell->getAllVideos();

// get by a tag
$items = $shotwell->getItemsByTag('diving');

// get all tags
$tags = $shotwell->getAllTags();

// set tag on an object
$shotwell->setItemTags('my-object-id', ['tag1', 'tag2']);

// set item rating
$shotwell->setItemRating('my-object-id', 3);

There are more functions, just check the class file.., (*12)

The Versions

12/06 2016

dev-develop

dev-develop

A PHP library providing a simple API to a Shotwell (the default Ubuntu image manager) sqlite database.

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6

 

The Development Requires

by Avatar narcoticfresh

12/06 2016

dev-master

9999999-dev

A PHP library providing a simple API to a Shotwell (the default Ubuntu image manager) sqlite database.

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6

 

The Development Requires

by Avatar narcoticfresh

12/06 2016

v0.9.0

0.9.0.0

A PHP library providing a simple API to a Shotwell (the default Ubuntu image manager) sqlite database.

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6

 

The Development Requires

by Avatar narcoticfresh