API for Albums¶
The Albums Class¶
- class digikamdb.albums.Albums(digikam)[source]¶
Bases:
DigikamTableOffers access to the albums in the Digikam instance.
Albumsrepresents all albums present in the Digikam database. It is usually accessed through theDigikampropertyalbums.Usage:
dk = Digikam(...) myalbum = dk.albums[42] # by id for album in dk.albums: # iterate print(album.relativePath)
- Parameters:
digikam (Digikam) – Digikam object for access to database and other classes.
See also
Class
Album
- find(path, exact=False)[source]¶
Finds albums by path name.
- Parameters:
path (str | bytes | PathLike) – Path to album(s). Can be given as any type that the
os.pathfunctions understand.exact (bool) – If true, look for exactly one album. If false, and
pathcontains subdirectories, these are also returned.
- Returns:
The found albums. If
exact == True, the album object is returned, orNoneif it was not found. Ifexact == False, returns a list with the found albums.- Raises:
DigikamDataIntegrityError – Database contains overlapping roots.
- Return type:
The Album Class (mapped)¶
- class _sqla.Album(**kwargs)¶
Bases:
DigikamObjectRepresents a row in the table
Albums.See also
Class
Albums
- property abspath: str¶
The album folder’s absolute path (read-only)
- versionchanged:: 0.3.5
Converted to lowercase for case-insensitive roots (except mountpoint).
- property caption: str¶
The album’s caption (description)
- property collection: str¶
The album’s collection
This property is named Category in Digikam.
- property date: date¶
The album’s date (read-only)
The date can be set in Digikam
- property id: int¶
The album’s id (read-only)
- property modificationDate: datetime¶
The album’s modification date (read-only)
- Raises:
DigikamVersionError – If DBVersion < 14
Added in version 0.2.2.
- property relativePath: str¶
The album’s path relative to the root (read-only)
The AlbumRoots Class¶
- class digikamdb.albumroots.AlbumRoots(digikam, override=None)[source]¶
Bases:
DigikamTableOffers access to the album roots in the Digikam instance.
AlbumRootsrepresents all album roots present in the Digikam database. It is usually accessed through theDigikampropertyalbumroots.Usage:
dk = Digikam(...) myroot = dk.albumroots[2] # by id for root in dk.albumroots: # iterate print(root.relativePath)
- Parameters:
See also
Class
AlbumRoot
- add(path, label=None, status=AlbumRootStatus.LocationAvailable, type_=AlbumRootType.UndefinedType, check_dir=True, use_uuid=True)[source]¶
Adds a new album root.
If check_dir is False, the identifier will be of
path=type, anduse_uuidis ignored. TheidentifierandrelativePathare derifed frompath.To add albums and images in the new album root, start Digikam and scand for new objects.
- Parameters:
path (str) – Path to new album root.
label (str | None) – Label of the new album root.
check_dir (bool) – Check if the directory exists and is not a subdir of another album root or vice versa.
status (AlbumRootStatus) – The new root’s status.
use_uuid (bool) – Use UUID of filesystem as identifier. If false, the is used as identifier.
type_ (AlbumRootType)
- Returns:
The newly created AlbumRoot object.
- Return type:
Note
The
Digikamparameterroot_overrideis ignored by this method.
The AlbumRoot Class (mapped)¶
- class _sqla.AlbumRoot(**kwargs)¶
Bases:
DigikamObjectDigikam Album Root
The location can be accessed with
abspath.Changed in version 0.3.5: *
path in rootchecks if a path is a subdirectory (and thus a Digikam album) of the album root. The reverse is checked byissubdir().See also
Class
AlbumRoots
- issubdir(path)¶
Checks if album root is a subdir of path.
Added in version 0.3.5.
- Parameters:
path (str)
- Return type:
bool
- property abspath: str¶
The album root’s absolute path (read-only)
The result can be modified if
root_overrideis specified in theDigikamconstructor.- versionchanged:: 0.3.5
Converted to lowercase for case-insensitive roots (except mountpoint).
- property caseSensitivity: bool¶
Indicates if this album root is case sensitive.
- Raises:
DigikamVersionError – If DBVersion < 16
Added in version 0.2.2.
- property id: int¶
The album root’s id (read-only)
- property identifier: str¶
The album root’s identifier
This often contains the UUID of the file system that containst the album root.
- property label: str¶
The album root’s label
- property mountpoint: str¶
The volume’s mount point (read-only)
The result can be modified if
root_overrideis specified in theDigikamconstructor.Changed in version 0.3.4: * Works if
identifiercontains multiple parameters. * Processmountpathparameter.
- override = None¶
- property specificPath: str¶
The album root’s path relative to
identifier, starting with/
- property status: AlbumRootStatus¶
The album root’s status (read-only)
This property is dynamically set by Digikam and only valid when Digikam is running.
- property type: AlbumRootType¶
The album root’s type (hardwired, removable or network)
Types of special properties¶
- class digikamdb.types.AlbumRootStatus(value)[source]¶
Bases:
IntEnumClass for
AlbumRoot.status- LocationAvailable = 0¶
- LocationHidden = 1¶