Skip to content

Commit

Permalink
Merge branch 'release/1.7.0' into 'master'
Browse files Browse the repository at this point in the history
Release 1.7.0

See merge request python/speechmatics-python-internal!73
  • Loading branch information
anjz committed Mar 1, 2023
2 parents c281e77 + bb5d0f6 commit 239b968
Show file tree
Hide file tree
Showing 21 changed files with 180 additions and 167 deletions.
18 changes: 10 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.7.0] - 2023-03-01

### Added

- Add support for language identification (DEL-10418)
- Add support for language identification

### Fixed

- Fixed an issue where `transcription_config` was not correctly loaded from the JSON config file

## [1.6.5] - 2023-02-22

### Fixed

- CLI transcript output now properly handles UTF-8

## [1.6.4] - 2023-02-14
Expand Down Expand Up @@ -250,8 +247,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added authentication token support for RT-SaaS [@rakeshv247](https://github.com/rakeshv247).

[unreleased]: https://github.com/speechmatics/speechmatics-python/compare/v1.5.1...HEAD
[1.5.1]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.5.1
[unreleased]: https://github.com/speechmatics/speechmatics-python/compare/v1.7.0...HEAD
[1.7.0]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.7.0
[1.6.4]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.6.4
[1.6.3]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.6.3
[1.6.2]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.6.2
[1.6.1]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.6.1
[1.6.0]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.6.0
[1.5.0]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.5.0
[1.4.5]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.4.5
[1.4.4]: https://github.com/speechmatics/speechmatics-python/releases/tag/1.4.4
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.5
1.7.0
2 changes: 1 addition & 1 deletion docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h3 id="searchlabel">Quick search</h3>

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>

</div>

Expand Down
28 changes: 14 additions & 14 deletions docs/_modules/speechmatics/batch_client.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>


<div class="viewcode-block" id="BatchClient"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient">[docs]</a><span class="k">class</span> <span class="nc">BatchClient</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;Client class for Speechmatics Batch ASR REST API.</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Client class for Speechmatics Batch ASR REST API.</span>

<span class="sd"> This client may be used directly but must be closed afterwards, e.g.::</span>

Expand All @@ -82,7 +82,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">connection_settings</span><span class="p">:</span> <span class="n">ConnectionSettings</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Constructor method.</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Constructor method.</span>

<span class="sd"> :param connection_settings: Connection settings for API</span>
<span class="sd"> :type connection_settings: speechmatics.models.ConnectionSettings.</span>
Expand All @@ -103,7 +103,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">api_client</span> <span class="o">=</span> <span class="kc">None</span>

<div class="viewcode-block" id="BatchClient.connect"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.connect">[docs]</a> <span class="k">def</span> <span class="nf">connect</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Create a connection to a Speechmatics Transcription REST endpoint&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Create a connection to a Speechmatics Transcription REST endpoint&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">api_client</span> <span class="o">=</span> <span class="n">httpx</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span>
<span class="n">base_url</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">connection_settings</span><span class="o">.</span><span class="n">url</span><span class="p">,</span>
<span class="n">timeout</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
Expand All @@ -121,7 +121,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>

<div class="viewcode-block" id="BatchClient.close"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.close">[docs]</a> <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Clean up/close client connection pool.</span>

<span class="sd"> This is required when using the client directly, but not required when</span>
Expand All @@ -132,7 +132,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">api_client</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></div>

<div class="viewcode-block" id="BatchClient.send_request"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.send_request">[docs]</a> <span class="k">def</span> <span class="nf">send_request</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">method</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">httpx</span><span class="o">.</span><span class="n">Response</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Send a request using httpx.Client()</span>

<span class="sd"> :param method: HTTP request method</span>
Expand All @@ -155,7 +155,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">response</span></div>

<div class="viewcode-block" id="BatchClient.list_jobs"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.list_jobs">[docs]</a> <span class="k">def</span> <span class="nf">list_jobs</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]]:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Lists last 100 jobs within 7 days associated with auth_token for the SaaS</span>
<span class="sd"> or all of the jobs for the batch appliance.</span>

Expand All @@ -171,7 +171,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">],</span> <span class="n">BatchTranscriptionConfig</span><span class="p">,</span> <span class="nb">str</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">PathLike</span>
<span class="p">],</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Submits audio and config for transcription.</span>

<span class="sd"> :param audio: Audio file path or tuple of filename and bytes</span>
Expand All @@ -194,7 +194,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="n">config_json</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">transcription_config</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="sd">&quot;&quot;&quot;Job configuration must be a BatchTranscriptionConfig object,</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Job configuration must be a BatchTranscriptionConfig object,</span>
<span class="sd"> a filepath as a string or Path object, or a dict&quot;&quot;&quot;</span>
<span class="p">)</span>
<span class="n">config_data</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="n">config_json</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s2">&quot;utf-8&quot;</span><span class="p">)}</span>
Expand All @@ -217,7 +217,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="n">job_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">transcription_format</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;json-v2&quot;</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Union</span><span class="p">[</span><span class="nb">bool</span><span class="p">,</span> <span class="nb">str</span><span class="p">,</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]]:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Request results of a transcription job.</span>

<span class="sd"> :param job_id: ID of previously submitted job.</span>
Expand Down Expand Up @@ -261,7 +261,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">text</span></div>

<div class="viewcode-block" id="BatchClient.delete_job"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.delete_job">[docs]</a> <span class="k">def</span> <span class="nf">delete_job</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">job_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">force</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Delete a job. Must pass force=True to cancel a running job.</span>

<span class="sd"> :param job_id: ID of previously submitted job.</span>
Expand Down Expand Up @@ -295,7 +295,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="kc">False</span></div>

<div class="viewcode-block" id="BatchClient.check_job_status"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.check_job_status">[docs]</a> <span class="k">def</span> <span class="nf">check_job_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">job_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Check the status of a job.</span>

<span class="sd"> :param job_id: ID of previously submitted job.</span>
Expand All @@ -318,7 +318,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<div class="viewcode-block" id="BatchClient.wait_for_completion"><a class="viewcode-back" href="../../batch_client.html#speechmatics.batch_client.BatchClient.wait_for_completion">[docs]</a> <span class="k">def</span> <span class="nf">wait_for_completion</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="n">job_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">transcription_format</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;txt&quot;</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]]:</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Blocks until job is complete, returning a transcript in</span>
<span class="sd"> the requested format.</span>

Expand Down Expand Up @@ -373,7 +373,7 @@ <h1>Source code for speechmatics.batch_client</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">_from_file</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="n">path</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">PathLike</span><span class="p">],</span> <span class="n">filetype</span><span class="p">:</span> <span class="nb">str</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Union</span><span class="p">[</span><span class="n">Dict</span><span class="p">[</span><span class="n">Any</span><span class="p">,</span> <span class="n">Any</span><span class="p">],</span> <span class="n">Tuple</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">bytes</span><span class="p">]]:</span>
<span class="sd">&quot;&quot;&quot;Retrieve data from a file.</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Retrieve data from a file.</span>
<span class="sd"> For filetype==&quot;json&quot;, returns a dict</span>
<span class="sd"> For filetype==&quot;binary&quot;, returns a tuple of (filename, data)</span>
<span class="sd"> &quot;&quot;&quot;</span>
Expand Down Expand Up @@ -461,7 +461,7 @@ <h3 id="searchlabel">Quick search</h3>

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>

</div>

Expand Down
Loading

0 comments on commit 239b968

Please sign in to comment.