Documentation

This commit is contained in:
Jamie Hardt
2022-11-26 19:33:35 -08:00
parent f8ce7b9ad9
commit cf39d19ef2
7 changed files with 14 additions and 10 deletions

View File

@@ -14,7 +14,10 @@ instance of :class:`WaveInfoReader`.
path = 'path/to/your/wave/audio.wav'
info = wavinfo.WavInfoReader(path)
adm_metadata = info.adm
ixml_metadata = info.ixml
.. module:: wavinfo
:noindex:

View File

@@ -7,6 +7,6 @@ See the documentation for `wavinfo.WavInfoReader` for more information.
from .wave_reader import WavInfoReader
from .riff_parser import WavInfoEOFError
__version__ = '2.1.0'
__version__ = '2.1.1'
__author__ = 'Jamie Hardt <jamiehardt@gmail.com>'
__license__ = "MIT"

View File

@@ -42,7 +42,7 @@ def main():
raise MissingDataError("adm")
elif options.ixml:
if this_file.ixml:
sys.stdout.write(this_file.ixml.xml_bytes())
sys.stdout.write(this_file.ixml.xml_str())
else:
raise MissingDataError("ixml")
else:

View File

@@ -53,7 +53,7 @@ class WavADMReader:
def programme(self) -> dict:
"""
Extract the ADM audioProgramme data structure and some of its reference properties
Read the ADM `audioProgramme` data structure and some of its reference properties.
"""
ret_dict = dict()
@@ -95,7 +95,7 @@ class WavADMReader:
return ret_dict
def track_info(self, index):
def track_info(self, index) -> dict:
"""
Information about a track in the WAV file.
@@ -151,7 +151,7 @@ class WavADMReader:
return ret_dict
def to_dict(self):
def to_dict(self) -> dict: #FIXME should be "asdict"
"""
Get ADM metadata as a dictionary.
"""

View File

@@ -598,7 +598,7 @@ class WavDolbyMetadataReader:
return retval
def __init__(self, dbmd_data) -> None:
def __init__(self, dbmd_data):
self.segment_list = []
h = BytesIO(dbmd_data)

View File

@@ -59,7 +59,7 @@ class WavInfoChunkReader:
else:
return None
def to_dict(self):
def to_dict(self) -> dict: #FIXME should be asdict
"""
A dictionary with all of the key/values read from the INFO scope.
"""

View File

@@ -27,7 +27,7 @@ class WavIXMLFormat:
else:
return None
def xml_bytes(self):
def xml_str(self) -> str:
return ET.tostring(self.parsed).decode("utf-8")
@property
@@ -41,7 +41,8 @@ class WavIXMLFormat:
def track_list(self):
"""
A description of each track.
:returns: An Iterator
:yields: `IXMLTrack` for each track.
"""
for track in self.parsed.find("./TRACK_LIST").iter():
if track.tag == 'TRACK':