sonicdb.database package¶
Submodules¶
sonicdb.database.base module¶
sonicdb.database.channel module¶
- class sonicdb.database.channel.Channel(**kwargs)[source]¶
Bases:
BaseRepresents a channel of a sensor in the database.
- id¶
Unique identifier for the channel.
- Type:
int
- number¶
Channel number of the sensor.
- Type:
int
- type_class¶
Type of sensor.
- Type:
str
- gain¶
Gain of the sensor.
- Type:
float
- sensor_id¶
Foreign key referencing the associated sensor.
- Type:
int
- files¶
List of File objects associated with the channel.
- Type:
list[File]
- events¶
List of EventChannel objects associated with the channel.
- Type:
list[EventChannel]
- dict()[source]¶
Convert the channel’s attributes to a dictionary.
- Returns:
Dictionary of channel attributes.
- Return type:
dict[str, int]
- Parameters:
self (Channel)
- events¶
List of events associated with the channel.
- Type:
list[EventChannel]
- files¶
List of files associated with the channel.
- Type:
list[File]
- gain¶
Gain value of the sensor.
- Type:
float
- get_end()[source]¶
Get the latest datetime from the channel’s files.
- Returns:
The latest recording datetime.
- Return type:
datetime
- Parameters:
self (Channel)
- get_start()[source]¶
Get the earliest datetime from the channel’s files.
- Returns:
The earliest recording datetime.
- Return type:
datetime
- Parameters:
self (Channel)
- id¶
Unique identifier for the channel.
- Type:
int
- number¶
Channel number of the sensor.
- Type:
int
- sensor_id¶
Foreign key linking to the sensor’s ID.
- Type:
int
- type_class¶
Type or classification of the sensor.
- Type:
str
sonicdb.database.event module¶
- class sonicdb.database.event.Event(**kwargs)[source]¶
Bases:
BaseRepresents an event in the database.
- id¶
Unique identifier for the event.
- Type:
int
- name¶
Name of the event.
- Type:
str
- start¶
Start time of the event.
- Type:
datetime
- end¶
End time of the event.
- Type:
datetime
- description¶
Description of the event.
- Type:
str
- subject_id¶
Foreign key linking to the associated subject.
- Type:
int
- channels¶
List of EventChannel objects associated with the event.
- Type:
list[EventChannel]
- channels¶
List of channels associated with the event.
- Type:
list[EventChannel]
- description¶
Description of the event.
- Type:
str
- end¶
End time of the event.
- Type:
datetime
- id¶
Unique identifier for the event.
- Type:
int
- name¶
Name of the event.
- Type:
str
- start¶
Start time of the event.
- Type:
datetime
- subject_id¶
Foreign key linking to the subject’s ID.
- Type:
int
- class sonicdb.database.event.EventChannel(**kwargs)[source]¶
Bases:
BaseRepresents the association between an event and a channel.
- event_id¶
Foreign key linking to the event’s ID.
- Type:
int
- channel_id¶
Foreign key linking to the channel’s ID.
- Type:
int
- channel_id¶
Foreign key linking to the channel’s ID.
- Type:
int
- event_id¶
Foreign key linking to the event’s ID.
- Type:
int
sonicdb.database.sample module¶
- class sonicdb.database.sample.Sample(**kwargs)[source]¶
Bases:
BaseRepresents a sample in the database.
- id¶
Unique identifier for the sample.
- Type:
int
- event_id¶
Foreign key linking to the associated event.
- Type:
int
- sensor_id¶
Foreign key linking to the associated sensor.
- Type:
int
- channel_id¶
Foreign key linking to the associated channel.
- Type:
int
- subject_id¶
Foreign key linking to the associated subject.
- Type:
int
- datetime¶
Datetime of the sample data.
- Type:
datetime
- file_id¶
Foreign key linking to the associated file.
- Type:
int
- file¶
Relationship to the File object where the sample audio comes from.
- Type:
File
- channel_id¶
Foreign key linking to the channel’s ID.
- Type:
int
- datetime¶
Datetime of the sample data.
- Type:
datetime
- event_id¶
Foreign key linking to the event’s ID.
- Type:
int
- file¶
Associated file object where the sample audio comes from.
- Type:
File
- file_id¶
Foreign key linking to the file’s ID.
- Type:
int
- get_audio()[source]¶
Retrieves the audio data associated with the sample.
- Returns:
The audio data of the sample.
- Return type:
- id¶
Unique identifier for the sample.
- Type:
int
- sensor_id¶
Foreign key linking to the sensor’s ID.
- Type:
int
- subject_id¶
Foreign key linking to the subject’s ID.
- Type:
int
sonicdb.database.sensor module¶
- class sonicdb.database.sensor.Sensor(**kwargs)[source]¶
Bases:
BaseRepresents a sensor in the database.
- id¶
Unique identifier for the sensor.
- Type:
int
- name¶
Name of the sensor.
- Type:
str
- subname¶
Subname of the sensor.
- Type:
str
- manufacturer¶
Manufacturer of the sensor.
- Type:
str
- type_class¶
Type class of the sensor.
- Type:
str
- number_of_channels¶
Number of channels the sensor supports.
- Type:
int
- channels¶
List of channels associated with the sensor.
- Type:
list
- samples¶
List of samples generated by the sensor audio files.
- Type:
list
- files¶
List of files recorded by the sensor.
- Type:
list
- channels¶
List of channels associated with the sensor.
- Type:
list
- files¶
List of files recorded by the sensor.
- Type:
list
- id¶
Unique identifier for the sensor.
- Type:
int
- manufacturer¶
Manufacturer of the sensor.
- Type:
str
- name¶
Name of the sensor.
- Type:
str
- number_of_channels¶
Number of channels the sensor supports.
- Type:
int
- samples¶
List of samples generated by the sensor audio files.
- Type:
list
- subname¶
Subname of the sensor.
- Type:
str
- type_class¶
Type class of the sensor.
- Type:
str
sonicdb.database.subject module¶
- class sonicdb.database.subject.Subject(**kwargs)[source]¶
Bases:
BaseRepresents a subject in the database.
- id¶
Unique identifier for the subject.
- Type:
int
- name¶
Name of the subject.
- Type:
str
- samples¶
List of Sample objects featuring the subject.
- Type:
list
- events¶
List of Event objects featuring the subject.
- Type:
list
- events¶
List of Event objects featuring the subject.
- Type:
list
- id¶
Unique identifier for the subject.
- Type:
int
- name¶
Name of the subject.
- Type:
str
- samples¶
List of Sample objects featuring the subject.
- Type:
list