Skip to content

ActiveRecord mappings for the Lightroom Catalog.

License

Notifications You must be signed in to change notification settings

alfanick/lrcat.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lrcat.rb

Build Status Code Climate Gem Version

ActiveRecord mappings for the Lightroom Catalog.

Project Status : Paused. I may work on it later but I don't have the time for now.

Documentation

Compatibility

Ruby

Lrcat.rb is currently compatible only with Ruby interpreters that supports C extensions because of the sqlite3 gem.
See Add support for JRuby.

Lightroom

Currently I am working on the support of the Lightroom 5 (and future version) catalog.

Installation

Add this line to your application's Gemfile:

gem 'lrcat'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lrcat

Usage

Basic usage

require 'lrcat'

# Open the catalog. (Please make a backup, this is experimental)
Lrcat::Catalog.open('Lightroom 5 Catalog.lrcat')

# Print the number of photos/camera model.
Lrcat::Catalog::CameraModel.all.each do |camera_model|
  puts "#{ camera_model.value } : #{ camera_model.images.count }"
end

Get the available models

Currently all the models defined under lrcat/catalog/ are available. However in future versions, as more models are implemented, some may be unavailable depending on the version of the catalog.
If you want to list the available models you can use Catalog#get_models:

Lrcat::Catalog.get_models
# => [:LibraryFile, :LibraryFolder, :LibraryRootFolder, :Image, :ExifMetadata, :AdditionalMetadata, :DevelopSettings, :Lens, :CameraModel, :CameraSerial]

Get the available columns

To know which field you can get on a specific model you can use ActiveRecord::Base#column_names:

Lrcat::Catalog::Lens.column_names
# => ["id_local", "searchIndex", "value"]

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

ActiveRecord mappings for the Lightroom Catalog.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages