Developers

If you are a developer and use pyexiv2 in your project, or if you want to check out the latest changes in the development branch, you will find here useful information.

In the following, we assume that you are running linux or any *nix system. However, the library and all the tools used are cross-platform, so very little tweaking should be needed to get it to work fine on Windows or MacOS X.

Checking out the code

Bazaar is used to keep track of the revisions on pyexiv2. Bazaar is a distributed version control system, which means that unlike CVS or subversion, there is no central repository from which you check out the sources. Instead, the sources are organized as branches hosted on filesystems or servers.
To start with, get the sources of pyexiv2 by checking out the development branch located at http://tilloy.net/branches/pyexiv2:

olivier@sanctuary:~/dev$ bzr co http://tilloy.net/branches/pyexiv2

There you are, you now have a local copy of pyexiv2:

olivier@sanctuary:~/dev$ ls -l pyexiv2/
total 36
-rw-r--r-- 1 olivier olivier   149 2007-09-01 21:23 ChangeLog
-rw-r--r-- 1 olivier olivier 17987 2007-09-01 21:23 COPYING
drwxr-xr-x 2 olivier olivier    48 2007-09-01 21:23 doc
-rw-r--r-- 1 olivier olivier  3168 2007-09-01 21:23 README
-rw-r--r-- 1 olivier olivier   112 2007-09-01 21:23 SConstruct
drwxr-xr-x 2 olivier olivier   280 2007-09-01 21:23 src
-rw-r--r-- 1 olivier olivier   565 2007-09-01 21:23 todo

If you want to check out a particular revision identified by a tag (all releases of pyexiv2 are tagged), use the following command:

olivier@sanctuary:~/dev$ bzr co -r tag:tag_name http://tilloy.net/branches/pyexiv2

A list of all the available tags can be obtained using the bzr tags command:

olivier@sanctuary:~/dev$ bzr tags -d http://tilloy.net/branches/pyexiv2
release-0.1          olivier@tilloy.net-20070830211232-vf02vzmbysfj257w
release-0.1.1        olivier@tilloy.net-20071014212751-n52ojcwvbukru98v

Building pyexiv2

The next step is to build the library and install it on your system. This process is handled by SCons, a software construction tool, that can be seen as a modern alternative to make.

First of all, you should make sure you have the correct dependencies installed on your system. These are:

Let's build the library by invoking SCons:

olivier@sanctuary:~/dev/pyexiv2$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/libpyexiv2.os -c -fPIC -I/usr/include/python2.5 src/libpyexiv2.cpp
g++ -o build/libpyexiv2_wrapper.os -c -fPIC -I/usr/include/python2.5 src/libpyexiv2_wrapper.cpp
g++ -o build/libpyexiv2.so -shared build/libpyexiv2.os build/libpyexiv2_wrapper.os -lboost_python -lexiv2
scons: done building targets.

Done! Let's have a look at the output of the build process:

olivier@sanctuary:~/dev/pyexiv2$ ls -l build/
total 820
-rw-r--r-- 1 olivier olivier 100000 2007-09-01 21:59 libpyexiv2.os
-rwxr-xr-x 1 olivier olivier 360359 2007-09-01 22:00 libpyexiv2.so
-rw-r--r-- 1 olivier olivier 373176 2007-09-01 22:00 libpyexiv2_wrapper.os

The interesting file is libpyexiv2.so, the low-level python binding to exiv2. Low-level that is, because on top of it is a pure python module that provides sexier methods for accessing image metadata. This module is the file src/pyexiv2.py.

Ok, now let's proceed to the installation on the system. For this step, you need to have administrator rights on your machine:

olivier@sanctuary:~/dev/pyexiv2$ sudo scons install
Password:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Install file: "build/libpyexiv2.so" as "/usr/lib/python2.5/libpyexiv2.so"
Install file: "build/pyexiv2.py" as "/usr/lib/python2.5/pyexiv2.py"
scons: done building targets.

Your python modules standard directory is automatically detected and used to install the library and the module.

That's it, you can start using pyexiv2, see sections Tutorial and Documentation.

Contributing

There are several ways in which you can contribute to improve pyexiv2.

Valide HTML 4.01 Valide CSS 2