Dependencies¶
- class audb.Dependencies[source]¶
Dependencies of a database.
audb.Dependencies
gathers all database media, table, and attachment files and metadata about them in a single object. The metadata contains information about the single files like duration, but also what version of the file is required.The dependencies of a database can be requested with
audb.dependencies()
.Examples
>>> deps = audb.Dependencies() >>> deps() Empty DataFrame Columns: [archive, bit_depth, channels, checksum, duration, format, removed, sampling_rate, type, version] Index: [] >>> # Request dependencies for emodb 1.4.1 >>> deps = audb.dependencies("emodb", version="1.4.1") >>> # List all files or archives >>> deps.files[:3] ['db.emotion.csv', 'db.files.csv', 'wav/03a01Fa.wav'] >>> deps.archives[:2] ['005d2b91-5317-0c80-d602-6d55f0323f8c', '014f82d8-3491-fd00-7397-c3b2ac3b2875'] >>> # Access properties for a given file >>> deps.archive("wav/03a01Fa.wav") 'c1f5cc6f-6d00-348a-ba3b-4adaa2436aad' >>> deps.duration("wav/03a01Fa.wav") 1.89825 >>> deps.removed("wav/03a01Fa.wav") False >>> # Check if a file is part of the dependencies >>> "wav/03a01Fa.wav" in deps True
__call__()¶
__contains__()¶
__eq__()¶
- Dependencies.__eq__(other)[source]¶
Check if two dependency tables are equal.
- Parameters
other (
Dependencies
) – dependency table to compare against- Return type
- Returns
True
if both dependency tables have the same entries
__getitem__()¶
__len__()¶
archive()¶
attachments¶
- Dependencies.attachments¶
Attachment paths (can be a file or a folder).
- Returns
list of attachments
bit_depth()¶
channels()¶
checksum()¶
duration()¶
format()¶
load()¶
- Dependencies.load(path)[source]¶
Read dependencies from file.
Clears existing dependencies.
- Parameters
path (
str
) – path to file. File extension can becsv
pkl
, orparquet
- Raises
ValueError – if file extension is not one of
csv
,pkl
,parquet
FileNotFoundError – if
path
does not exists
removed()¶
sampling_rate()¶
save()¶
table_ids¶
- Dependencies.table_ids¶
Table IDs.
Like
audb.Dependencies.tables()
, but only returns the table ID, i.e.db.<id>.csv
.- Returns
list of table IDs