From cf39d19ef24b2c8a9eb7db5d0b3b7f2f55cffced Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 26 Nov 2022 19:33:35 -0800 Subject: [PATCH] Documentation --- docs/source/quickstart.rst | 5 ++++- wavinfo/__init__.py | 2 +- wavinfo/__main__.py | 2 +- wavinfo/wave_adm_reader.py | 6 +++--- wavinfo/wave_dbmd_reader.py | 2 +- wavinfo/wave_info_reader.py | 2 +- wavinfo/wave_ixml_reader.py | 5 +++-- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index 1fcf208..123e87a 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -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: diff --git a/wavinfo/__init__.py b/wavinfo/__init__.py index 6fc7670..245a55e 100644 --- a/wavinfo/__init__.py +++ b/wavinfo/__init__.py @@ -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 ' __license__ = "MIT" diff --git a/wavinfo/__main__.py b/wavinfo/__main__.py index d3539c3..8f24676 100644 --- a/wavinfo/__main__.py +++ b/wavinfo/__main__.py @@ -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: diff --git a/wavinfo/wave_adm_reader.py b/wavinfo/wave_adm_reader.py index 3d3e6da..e3155e1 100644 --- a/wavinfo/wave_adm_reader.py +++ b/wavinfo/wave_adm_reader.py @@ -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. """ diff --git a/wavinfo/wave_dbmd_reader.py b/wavinfo/wave_dbmd_reader.py index 63dd6e8..33423fc 100644 --- a/wavinfo/wave_dbmd_reader.py +++ b/wavinfo/wave_dbmd_reader.py @@ -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) diff --git a/wavinfo/wave_info_reader.py b/wavinfo/wave_info_reader.py index 626c11d..8aae35d 100644 --- a/wavinfo/wave_info_reader.py +++ b/wavinfo/wave_info_reader.py @@ -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. """ diff --git a/wavinfo/wave_ixml_reader.py b/wavinfo/wave_ixml_reader.py index d014db0..d4b83bb 100644 --- a/wavinfo/wave_ixml_reader.py +++ b/wavinfo/wave_ixml_reader.py @@ -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':